From 39599dca9db7431510f1d68609db5ea0b60af2cb Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Thu, 22 Nov 2007 02:48:12 +0000 Subject: PyString_AsString is permissive and accepts unicode strings. Replace it with PyUnicode_AsString when the argument is known to be a str. --- Python/ast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/ast.c') diff --git a/Python/ast.c b/Python/ast.c index 2a5d8b8571..f3a282861a 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1299,7 +1299,7 @@ ast_for_atom(struct compiling *c, const node *n) 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 { -- cgit v1.2.1