diff Python/ast.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 068655054b0d
children ebc7389297d6
line wrap: on
line diff
--- a/Python/ast.c	Thu Nov 22 01:09:33 2007 +0000
+++ b/Python/ast.c	Thu Nov 22 02:48:12 2007 +0000
@@ -1299,7 +1299,7 @@
                 if (errstr) {
                     char *s = "";
                     char buf[128];
-                    s = PyString_AsString(errstr);
+                    s = PyUnicode_AsString(errstr);
                     PyOS_snprintf(buf, sizeof(buf), "(unicode error) %s", s);
                     ast_error(n, buf);
                 } else {