summaryrefslogtreecommitdiffstats
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-05-25 07:24:42 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-05-25 07:24:42 (GMT)
commit18eac4a1d67b3b4a6f51608f0c3c82fa662100b0 (patch)
tree76e16bd6d10bb4ce86da63551129c35b1273703a /Modules/zipimport.c
parenta6a7a1accfa07c4b2666796c88392c1b1a078bee (diff)
downloadcpython-18eac4a1d67b3b4a6f51608f0c3c82fa662100b0.zip
cpython-18eac4a1d67b3b4a6f51608f0c3c82fa662100b0.tar.gz
cpython-18eac4a1d67b3b4a6f51608f0c3c82fa662100b0.tar.bz2
use PyDict_Contains
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r--Modules/zipimport.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 5ff39bb..70a57c9 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -268,7 +268,7 @@ static int
check_is_directory(ZipImporter *self, PyObject* prefix, PyObject *path)
{
PyObject *dirpath;
- PyObject *item;
+ int res;
/* See if this is a "directory". If so, it's eligible to be part
of a namespace package. We test by seeing if the name, with an
@@ -277,9 +277,9 @@ check_is_directory(ZipImporter *self, PyObject* prefix, PyObject *path)
if (dirpath == NULL)
return -1;
/* If dirpath is present in self->files, we have a directory. */
- item = PyDict_GetItem(self->files, dirpath);
+ res = PyDict_Contains(self->files, dirpath);
Py_DECREF(dirpath);
- return item != NULL;
+ return res;
}
/* Return some information about a module. */