diff Objects/setobject.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 85cf334b32c3
children 1f024a95e9d9
line wrap: on
line diff
--- a/Objects/setobject.c	Thu Nov 22 01:09:33 2007 +0000
+++ b/Objects/setobject.c	Thu Nov 22 02:48:12 2007 +0000
@@ -2303,7 +2303,7 @@
 	/* Exercise direct iteration */
 	i = 0, count = 0;
 	while (_PySet_Next((PyObject *)dup, &i, &x)) {
-		s = PyString_AsString(x);
+		s = PyUnicode_AsString(x);
 		assert(s && (s[0] == 'a' || s[0] == 'b' || s[0] == 'c'));
 		count++;
 	}