diff Python/peephole.c @ 43961:b231bda653a4

PyString_AsString is permissive and accepts unicode strings. Replace it with PyUnicode_AsString when the argument is known to be a str.
author Amaury Forgeot d'Arc <amauryfa@gmail.com>
date Thu, 22 Nov 2007 02:48:12 +0000
parents 229c28cb9afb
children 8b52ff41e0e2
line wrap: on
line diff
--- a/Python/peephole.c	Thu Nov 22 01:09:33 2007 +0000
+++ b/Python/peephole.c	Thu Nov 22 02:48:12 2007 +0000
@@ -407,7 +407,7 @@
 			case LOAD_NAME:
 			case LOAD_GLOBAL:
 				j = GETARG(codestr, i);
-				name = PyString_AsString(PyTuple_GET_ITEM(names, j));
+				name = PyUnicode_AsString(PyTuple_GET_ITEM(names, j));
 				h = load_global(codestr, i, name, consts);
 				if (h < 0)
 					goto exitUnchanged;