summaryrefslogtreecommitdiff
path: root/Python/peephole.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-22 02:48:12 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-22 02:48:12 +0000
commit6dd7ea4ce6f63c5b298183bfbec5bad0de859f02 (patch)
tree030bfaa91a8a20f280af7340c8f5aa7c7cf207b7 /Python/peephole.c
parent651c4e6eb025f798890192b75a53598c44e19af5 (diff)
downloadcpython-6dd7ea4ce6f63c5b298183bfbec5bad0de859f02.tar.gz
PyString_AsString is permissive and accepts unicode strings.
Replace it with PyUnicode_AsString when the argument is known to be a str.
Diffstat (limited to 'Python/peephole.c')
-rw-r--r--Python/peephole.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/peephole.c b/Python/peephole.c
index d012d391e7..9f1e6420e6 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -407,7 +407,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
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;