Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 59213:370e1a1c2386
Strip out trailing whitespace.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Mon, 01 Mar 2010 02:09:17 +0000 |
| parents | 8b8aee21d85e |
| children | 58c35495a934 |
line wrap: on
line diff
--- a/Python/import.c Mon Mar 01 02:05:26 2010 +0000 +++ b/Python/import.c Mon Mar 01 02:09:17 2010 +0000 @@ -19,7 +19,7 @@ #include <fcntl.h> #endif #ifdef __cplusplus -extern "C" { +extern "C" { #endif #ifdef MS_WINDOWS @@ -530,7 +530,7 @@ dictionary is stored by calling _PyImport_FixupExtension() immediately after the module initialization function succeeds. A copy can be retrieved from there by calling - _PyImport_FindExtension(). + _PyImport_FindExtension(). Modules which do support multiple multiple initialization set their m_size field to a non-negative number (indicating the size @@ -566,7 +566,7 @@ } if (def->m_size == -1) { if (def->m_base.m_copy) { - /* Somebody already imported the module, + /* Somebody already imported the module, likely under a different name. XXX this should really not happen. */ Py_DECREF(def->m_base.m_copy); @@ -624,7 +624,7 @@ PySys_WriteStderr("import %s # previously loaded (%s)\n", name, filename); return mod; - + } @@ -862,7 +862,7 @@ flags.cf_flags = 0; mod = PyParser_ASTFromFile(fp, pathname, NULL, - Py_file_input, 0, 0, &flags, + Py_file_input, 0, 0, &flags, NULL, arena); if (mod) { co = PyAST_Compile(mod, pathname, NULL, arena); @@ -920,7 +920,7 @@ mode_t mode = srcstat->st_mode & ~S_IEXEC; #else mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH; -#endif +#endif fp = open_exclusive(cpathname, mode); if (fp == NULL) { @@ -1010,7 +1010,7 @@ char *cpathname; PyCodeObject *co; PyObject *m; - + if (fstat(fileno(fp), &st) != 0) { PyErr_Format(PyExc_RuntimeError, "unable to get file status from '%s'", @@ -1383,7 +1383,7 @@ if (!v) return NULL; if (PyUnicode_Check(v)) { - v = PyUnicode_AsEncodedString(v, + v = PyUnicode_AsEncodedString(v, Py_FileSystemDefaultEncoding, NULL); if (v == NULL) return NULL; @@ -1456,7 +1456,7 @@ else { char warnstr[MAXPATHLEN+80]; sprintf(warnstr, "Not importing directory " - "'%.*s': missing __init__.py", + "'%.*s': missing __init__.py", MAXPATHLEN, buf); if (PyErr_WarnEx(PyExc_ImportWarning, warnstr, 1)) { @@ -2270,7 +2270,7 @@ modname = PyDict_GetItem(globals, namestr); if (modname == NULL || !PyUnicode_Check(modname)) return Py_None; - + modpath = PyDict_GetItem(globals, pathstr); if (modpath != NULL) { /* __path__ is set, so modname is already the package name */ @@ -2643,7 +2643,7 @@ struct filedescr *fdp; FILE *fp = NULL; PyObject *newm; - + if (modules_reloading == NULL) { Py_FatalError("PyImport_ReloadModule: " "no modules_reloading dictionary!"); @@ -3039,8 +3039,8 @@ PyObject *m; FILE *fp; if (!PyArg_ParseTuple(args, "ses|O:load_compiled", - &name, - Py_FileSystemDefaultEncoding, &pathname, + &name, + Py_FileSystemDefaultEncoding, &pathname, &fob)) return NULL; fp = get_file(pathname, fob, "rb"); @@ -3065,8 +3065,8 @@ PyObject *m; FILE *fp = NULL; if (!PyArg_ParseTuple(args, "ses|O:load_dynamic", - &name, - Py_FileSystemDefaultEncoding, &pathname, + &name, + Py_FileSystemDefaultEncoding, &pathname, &fob)) return NULL; if (fob) { @@ -3094,7 +3094,7 @@ PyObject *m; FILE *fp; if (!PyArg_ParseTuple(args, "ses|O:load_source", - &name, + &name, Py_FileSystemDefaultEncoding, &pathname, &fob)) return NULL; @@ -3122,7 +3122,7 @@ FILE *fp; if (!PyArg_ParseTuple(args, "sOes(ssi):load_module", - &name, &fob, + &name, &fob, Py_FileSystemDefaultEncoding, &pathname, &suffix, &mode, &type)) return NULL; @@ -3146,7 +3146,7 @@ PyMem_Free(pathname); return NULL; } - } + } ret = load_module(name, fp, pathname, type, NULL); PyMem_Free(pathname); if (fp) @@ -3160,7 +3160,7 @@ char *name; char *pathname; PyObject * ret; - if (!PyArg_ParseTuple(args, "ses:load_package", + if (!PyArg_ParseTuple(args, "ses:load_package", &name, Py_FileSystemDefaultEncoding, &pathname)) return NULL; ret = load_package(name, pathname);
