[Python-checkins] r83304 - python/branches/import_unicode/Python/import.c

victor.stinner python-checkins at python.org
Fri Jul 30 23:04:11 CEST 2010


Author: victor.stinner
Date: Fri Jul 30 23:04:11 2010
New Revision: 83304

Log:
re-fix filename match in get_sourcefile()

Modified:
   python/branches/import_unicode/Python/import.c

Modified: python/branches/import_unicode/Python/import.c
==============================================================================
--- python/branches/import_unicode/Python/import.c	(original)
+++ python/branches/import_unicode/Python/import.c	Fri Jul 30 23:04:11 2010
@@ -1452,10 +1452,10 @@
     file = PyUnicode_AS_UNICODE(fileobj);
 
     /* match '*.py?' */
-    if (5 <= len
-        && file[len-4] == '.'
-        && (file[len-3] == 'p' || file[len-3] == 'P')
-        && (file[len-2] == 'y' || file[len-2] == 'Y')) {
+    if (len < 5
+        || file[len-4] != '.'
+        || (file[len-3] != 'p' && file[len-3] != 'P')
+        || (file[len-2] != 'y' && file[len-2] != 'Y')) {
         Py_INCREF(fileobj);
         return fileobj;
     }


More information about the Python-checkins mailing list