[Python-checkins] cpython: use PyDict_Contains

benjamin.peterson python-checkins at python.org
Fri May 25 09:26:30 CEST 2012


http://hg.python.org/cpython/rev/17f48832e749
changeset: 77133:17f48832e749
user: Benjamin Peterson <benjamin at python.org>
date: Fri May 25 00:24:42 2012 -0700
summary:
 use PyDict_Contains
files:
 Modules/zipimport.c | 6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -268,7 +268,7 @@
 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 @@
 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. */
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /