diff Objects/classobject.c @ 4142:44872f255f93 legacy-trunk

Use getstringsize where available instead of strlen.
author Guido van Rossum <guido@python.org>
date Mon, 26 Aug 1996 14:58:03 +0000
parents 5d52395f40b0
children 0036dcf28402
line wrap: on
line diff
--- a/Objects/classobject.c	Mon Aug 26 14:38:40 1996 +0000
+++ b/Objects/classobject.c	Mon Aug 26 14:58:03 1996 +0000
@@ -550,7 +550,7 @@
 	if (sname[0] == '_' && sname[1] == '_'
 	    && (strcmp(sname, "__dict__") == 0 ||
 		strcmp(sname, "__class__") == 0)) {
-	        int n = strlen(sname);
+	        int n = getstringsize(name);
 		if (sname[n-1] == '_' && sname[n-2] == '_') {
 			err_setstr(TypeError, "read-only special attribute");
 			return -1;