[issue4225] unicode_literals doesn't work in exec

Amaury Forgeot d'Arc report at bugs.python.org
Wed Oct 29 09:57:31 CET 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

The attached patch works, but can be simplified by using a stack variable:

Index: pythonrun.c
===================================================================
--- pythonrun.c	(revision 66902)
+++ pythonrun.c	(working copy)
@@ -1284,7 +1290,13 @@

 {
 	PyObject *ret = NULL;
 	mod_ty mod;
-	PyArena *arena = PyArena_New();
+	PyCompilerFlags localflags;
+	PyArena *arena;
+
+	if (flags == NULL)
+		flags = &localflags;
+
+	arena = PyArena_New();
 	if (arena == NULL)
 		return NULL;

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4225>
_______________________________________


More information about the Python-bugs-list mailing list