diff Python/future.c @ 75870:1b467efb9b27 3.2

check for NULL
author Benjamin Peterson <benjamin@python.org>
date Thu, 22 Mar 2012 08:56:15 -0400
parents f57cbcefde34
children 79422b3684f1
line wrap: on
line diff
--- a/Python/future.c	Thu Mar 22 08:19:04 2012 -0400
+++ b/Python/future.c	Thu Mar 22 08:56:15 2012 -0400
@@ -87,7 +87,8 @@
 
         if (s->kind == ImportFrom_kind) {
             PyObject *modname = s->v.ImportFrom.module;
-            if (!PyUnicode_CompareWithASCIIString(modname, "__future__")) {
+            if (modname &&
+                !PyUnicode_CompareWithASCIIString(modname, "__future__")) {
                 if (done) {
                     PyErr_SetString(PyExc_SyntaxError,
                                     ERR_LATE_FUTURE);