Skip to content

Instantly share code, notes, and snippets.

@mdboom
Created June 21, 2011 22:07
Show Gist options
  • Save mdboom/1039046 to your computer and use it in GitHub Desktop.
Save mdboom/1039046 to your computer and use it in GitHub Desktop.
Initialize pth_list pointer to prevent AttributeError in imp.reload
diff -r 2c353e4e2488 Python/import.c
--- a/Python/import.c Sun Jun 12 22:18:12 2011 +0200
+++ b/Python/import.c Tue Jun 21 18:03:42 2011 -0400
@@ -3763,7 +3763,7 @@
PyObject *modules_reloading = interp->modules_reloading;
PyObject *modules = PyImport_GetModuleDict();
PyObject *path_list = NULL, *loader = NULL, *existing_m = NULL;
- PyObject *nameobj, *bufobj, *subnameobj, *pth_list;
+ PyObject *nameobj, *bufobj, *subnameobj, *pth_list = NULL;
Py_UNICODE *name, *subname;
struct filedescr *fdp;
FILE *fp = NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment