check for NULL
diff --git a/Python/future.c b/Python/future.c
index 978dc25..89592e2 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -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);