Skip to content

Commit ab79c71

Browse files
committed
check for NULL
1 parent a4e4e35 commit ab79c71

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/future.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
8787

8888
if (s->kind == ImportFrom_kind) {
8989
PyObject *modname = s->v.ImportFrom.module;
90-
if (!PyUnicode_CompareWithASCIIString(modname, "__future__")) {
90+
if (modname &&
91+
!PyUnicode_CompareWithASCIIString(modname, "__future__")) {
9192
if (done) {
9293
PyErr_SetString(PyExc_SyntaxError,
9394
ERR_LATE_FUTURE);

0 commit comments

Comments
 (0)