diff Python/ast.c @ 65400:9ed68dd6b71f

Fix ast_error_finish() and err_input(): filename can be NULL Fix my previous commit (r85569).
author Victor Stinner <victor.stinner@haypocalc.com>
date Sat, 16 Oct 2010 13:42:53 +0000
parents 55ed5c524428
children 724920a015f7
line wrap: on
line diff
--- a/Python/ast.c	Sat Oct 16 13:14:10 2010 +0000
+++ b/Python/ast.c	Sat Oct 16 13:42:53 2010 +0000
@@ -131,7 +131,12 @@
         Py_INCREF(Py_None);
         loc = Py_None;
     }
-    filename_obj = PyUnicode_DecodeFSDefault(filename);
+    if (filename != NULL)
+        filename_obj = PyUnicode_DecodeFSDefault(filename);
+    else {
+        Py_INCREF(Py_None);
+        filename_obj = Py_None;
+    }
     if (filename_obj != NULL)
         tmp = Py_BuildValue("(NlOO)", filename_obj, lineno, offset, loc);
     else