Commit 9a5b25a3 authored by Brett Cannon's avatar Brett Cannon

Strip out trailing whitespace.

parent 86508cc8
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
...@@ -530,7 +530,7 @@ PyImport_GetMagicNumber(void) ...@@ -530,7 +530,7 @@ PyImport_GetMagicNumber(void)
dictionary is stored by calling _PyImport_FixupExtension() dictionary is stored by calling _PyImport_FixupExtension()
immediately after the module initialization function succeeds. A immediately after the module initialization function succeeds. A
copy can be retrieved from there by calling copy can be retrieved from there by calling
_PyImport_FindExtension(). _PyImport_FindExtension().
Modules which do support multiple multiple initialization set Modules which do support multiple multiple initialization set
their m_size field to a non-negative number (indicating the size their m_size field to a non-negative number (indicating the size
...@@ -566,7 +566,7 @@ _PyImport_FixupExtension(PyObject *mod, char *name, char *filename) ...@@ -566,7 +566,7 @@ _PyImport_FixupExtension(PyObject *mod, char *name, char *filename)
} }
if (def->m_size == -1) { if (def->m_size == -1) {
if (def->m_base.m_copy) { if (def->m_base.m_copy) {
/* Somebody already imported the module, /* Somebody already imported the module,
likely under a different name. likely under a different name.
XXX this should really not happen. */ XXX this should really not happen. */
Py_DECREF(def->m_base.m_copy); Py_DECREF(def->m_base.m_copy);
...@@ -624,7 +624,7 @@ _PyImport_FindExtension(char *name, char *filename) ...@@ -624,7 +624,7 @@ _PyImport_FindExtension(char *name, char *filename)
PySys_WriteStderr("import %s # previously loaded (%s)\n", PySys_WriteStderr("import %s # previously loaded (%s)\n",
name, filename); name, filename);
return mod; return mod;
} }
...@@ -862,7 +862,7 @@ parse_source_module(const char *pathname, FILE *fp) ...@@ -862,7 +862,7 @@ parse_source_module(const char *pathname, FILE *fp)
flags.cf_flags = 0; flags.cf_flags = 0;
mod = PyParser_ASTFromFile(fp, pathname, NULL, mod = PyParser_ASTFromFile(fp, pathname, NULL,
Py_file_input, 0, 0, &flags, Py_file_input, 0, 0, &flags,
NULL, arena); NULL, arena);
if (mod) { if (mod) {
co = PyAST_Compile(mod, pathname, NULL, arena); co = PyAST_Compile(mod, pathname, NULL, arena);
...@@ -920,7 +920,7 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat) ...@@ -920,7 +920,7 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
mode_t mode = srcstat->st_mode & ~S_IEXEC; mode_t mode = srcstat->st_mode & ~S_IEXEC;
#else #else
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH; mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
#endif #endif
fp = open_exclusive(cpathname, mode); fp = open_exclusive(cpathname, mode);
if (fp == NULL) { if (fp == NULL) {
...@@ -1010,7 +1010,7 @@ load_source_module(char *name, char *pathname, FILE *fp) ...@@ -1010,7 +1010,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
char *cpathname; char *cpathname;
PyCodeObject *co; PyCodeObject *co;
PyObject *m; PyObject *m;
if (fstat(fileno(fp), &st) != 0) { if (fstat(fileno(fp), &st) != 0) {
PyErr_Format(PyExc_RuntimeError, PyErr_Format(PyExc_RuntimeError,
"unable to get file status from '%s'", "unable to get file status from '%s'",
...@@ -1383,7 +1383,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, ...@@ -1383,7 +1383,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
if (!v) if (!v)
return NULL; return NULL;
if (PyUnicode_Check(v)) { if (PyUnicode_Check(v)) {
v = PyUnicode_AsEncodedString(v, v = PyUnicode_AsEncodedString(v,
Py_FileSystemDefaultEncoding, NULL); Py_FileSystemDefaultEncoding, NULL);
if (v == NULL) if (v == NULL)
return NULL; return NULL;
...@@ -1456,7 +1456,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, ...@@ -1456,7 +1456,7 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf,
else { else {
char warnstr[MAXPATHLEN+80]; char warnstr[MAXPATHLEN+80];
sprintf(warnstr, "Not importing directory " sprintf(warnstr, "Not importing directory "
"'%.*s': missing __init__.py", "'%.*s': missing __init__.py",
MAXPATHLEN, buf); MAXPATHLEN, buf);
if (PyErr_WarnEx(PyExc_ImportWarning, if (PyErr_WarnEx(PyExc_ImportWarning,
warnstr, 1)) { warnstr, 1)) {
...@@ -2270,7 +2270,7 @@ get_parent(PyObject *globals, char *buf, Py_ssize_t *p_buflen, int level) ...@@ -2270,7 +2270,7 @@ get_parent(PyObject *globals, char *buf, Py_ssize_t *p_buflen, int level)
modname = PyDict_GetItem(globals, namestr); modname = PyDict_GetItem(globals, namestr);
if (modname == NULL || !PyUnicode_Check(modname)) if (modname == NULL || !PyUnicode_Check(modname))
return Py_None; return Py_None;
modpath = PyDict_GetItem(globals, pathstr); modpath = PyDict_GetItem(globals, pathstr);
if (modpath != NULL) { if (modpath != NULL) {
/* __path__ is set, so modname is already the package name */ /* __path__ is set, so modname is already the package name */
...@@ -2643,7 +2643,7 @@ PyImport_ReloadModule(PyObject *m) ...@@ -2643,7 +2643,7 @@ PyImport_ReloadModule(PyObject *m)
struct filedescr *fdp; struct filedescr *fdp;
FILE *fp = NULL; FILE *fp = NULL;
PyObject *newm; PyObject *newm;
if (modules_reloading == NULL) { if (modules_reloading == NULL) {
Py_FatalError("PyImport_ReloadModule: " Py_FatalError("PyImport_ReloadModule: "
"no modules_reloading dictionary!"); "no modules_reloading dictionary!");
...@@ -3039,8 +3039,8 @@ imp_load_compiled(PyObject *self, PyObject *args) ...@@ -3039,8 +3039,8 @@ imp_load_compiled(PyObject *self, PyObject *args)
PyObject *m; PyObject *m;
FILE *fp; FILE *fp;
if (!PyArg_ParseTuple(args, "ses|O:load_compiled", if (!PyArg_ParseTuple(args, "ses|O:load_compiled",
&name, &name,
Py_FileSystemDefaultEncoding, &pathname, Py_FileSystemDefaultEncoding, &pathname,
&fob)) &fob))
return NULL; return NULL;
fp = get_file(pathname, fob, "rb"); fp = get_file(pathname, fob, "rb");
...@@ -3065,8 +3065,8 @@ imp_load_dynamic(PyObject *self, PyObject *args) ...@@ -3065,8 +3065,8 @@ imp_load_dynamic(PyObject *self, PyObject *args)
PyObject *m; PyObject *m;
FILE *fp = NULL; FILE *fp = NULL;
if (!PyArg_ParseTuple(args, "ses|O:load_dynamic", if (!PyArg_ParseTuple(args, "ses|O:load_dynamic",
&name, &name,
Py_FileSystemDefaultEncoding, &pathname, Py_FileSystemDefaultEncoding, &pathname,
&fob)) &fob))
return NULL; return NULL;
if (fob) { if (fob) {
...@@ -3094,7 +3094,7 @@ imp_load_source(PyObject *self, PyObject *args) ...@@ -3094,7 +3094,7 @@ imp_load_source(PyObject *self, PyObject *args)
PyObject *m; PyObject *m;
FILE *fp; FILE *fp;
if (!PyArg_ParseTuple(args, "ses|O:load_source", if (!PyArg_ParseTuple(args, "ses|O:load_source",
&name, &name,
Py_FileSystemDefaultEncoding, &pathname, Py_FileSystemDefaultEncoding, &pathname,
&fob)) &fob))
return NULL; return NULL;
...@@ -3122,7 +3122,7 @@ imp_load_module(PyObject *self, PyObject *args) ...@@ -3122,7 +3122,7 @@ imp_load_module(PyObject *self, PyObject *args)
FILE *fp; FILE *fp;
if (!PyArg_ParseTuple(args, "sOes(ssi):load_module", if (!PyArg_ParseTuple(args, "sOes(ssi):load_module",
&name, &fob, &name, &fob,
Py_FileSystemDefaultEncoding, &pathname, Py_FileSystemDefaultEncoding, &pathname,
&suffix, &mode, &type)) &suffix, &mode, &type))
return NULL; return NULL;
...@@ -3146,7 +3146,7 @@ imp_load_module(PyObject *self, PyObject *args) ...@@ -3146,7 +3146,7 @@ imp_load_module(PyObject *self, PyObject *args)
PyMem_Free(pathname); PyMem_Free(pathname);
return NULL; return NULL;
} }
} }
ret = load_module(name, fp, pathname, type, NULL); ret = load_module(name, fp, pathname, type, NULL);
PyMem_Free(pathname); PyMem_Free(pathname);
if (fp) if (fp)
...@@ -3160,7 +3160,7 @@ imp_load_package(PyObject *self, PyObject *args) ...@@ -3160,7 +3160,7 @@ imp_load_package(PyObject *self, PyObject *args)
char *name; char *name;
char *pathname; char *pathname;
PyObject * ret; PyObject * ret;
if (!PyArg_ParseTuple(args, "ses:load_package", if (!PyArg_ParseTuple(args, "ses:load_package",
&name, Py_FileSystemDefaultEncoding, &pathname)) &name, Py_FileSystemDefaultEncoding, &pathname))
return NULL; return NULL;
ret = load_package(name, pathname); ret = load_package(name, pathname);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment