[Python-checkins] python/dist/src/Python import.c,2.240,2.241

loewis at users.sourceforge.net loewis at users.sourceforge.net
Fri Mar 4 20:40:38 CET 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22139/Python

Modified Files:
	import.c 
Log Message:
Patch #1043890: tarfile: add extractall() method.


Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.240
retrieving revision 2.241
diff -u -d -r2.240 -r2.241
--- import.c	7 Oct 2004 06:46:25 -0000	2.240
+++ import.c	4 Mar 2005 19:40:35 -0000	2.241
@@ -898,9 +898,9 @@
 
 
 /* Forward */
-static PyObject *load_module(char *, FILE *, char *, int, PyObject *);
+static PyObject *load_module(char *, FILE *, PyObject *, int, PyObject *);
 static struct filedescr *find_module(char *, char *, PyObject *,
-				     char *, size_t, FILE **, PyObject **);
+				     PyObject **, FILE **, PyObject **);
 static struct _frozen *find_frozen(char *name);
 
 /* Load a package and return its module object WITH INCREMENTED
[...1000 lines suppressed...]
 		      fob, pathname, fdp->suffix, fdp->mode, fdp->type);
+	Py_XDECREF(fname);
 	Py_DECREF(fob);
 	return ret;
 }
@@ -2691,7 +2699,13 @@
 		if (fp == NULL)
 			return NULL;
 	}
-	return load_module(name, fp, pathname, type, NULL);
+	{
+		PyObject *result;
+		PyObject *fname = PyString_FromString(pathname);
+		result = load_module(name, fp, fname, type, NULL);
+		Py_DECREF(fname);
+		return result;
+	}
 }
 
 static PyObject *



More information about the Python-checkins mailing list