summaryrefslogtreecommitdiff
path: root/Python/future.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-22 08:56:15 -0400
committerBenjamin Peterson <benjamin@python.org>2012-03-22 08:56:15 -0400
commit474fb69283735e7d444cf26eb29306e9e7d2fb93 (patch)
tree9e55b87d705f0f3740a73e8fe25e660b9872e657 /Python/future.c
parent7a47e4135954f91feb742530ebf6a0db0e80ef41 (diff)
downloadcpython-474fb69283735e7d444cf26eb29306e9e7d2fb93.tar.gz
check for NULL
Diffstat (limited to 'Python/future.c')
-rw-r--r--Python/future.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/future.c b/Python/future.c
index 978dc25306..89592e2224 100644
--- a/Python/future.c
+++ b/Python/future.c
@@ -87,7 +87,8 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
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);