diff Objects/typeobject.c @ 47260:49906d432b47

#2963: fix method cache types.
author Georg Brandl <georg@python.org>
date Sun, 25 May 2008 09:32:09 +0000
parents dd5513b472dc
children 23ab586c427a
line wrap: on
line diff
--- a/Objects/typeobject.c	Sun May 25 09:24:38 2008 +0000
+++ b/Objects/typeobject.c	Sun May 25 09:32:09 2008 +0000
@@ -20,10 +20,10 @@
 		 >> (8*sizeof(unsigned int) - MCACHE_SIZE_EXP))
 #define MCACHE_HASH_METHOD(type, name)                                  \
 		MCACHE_HASH((type)->tp_version_tag,                     \
-		            ((PyStringObject *)(name))->ob_shash)
+		            ((PyUnicodeObject *)(name))->hash)
 #define MCACHE_CACHEABLE_NAME(name)                                     \
-		PyString_CheckExact(name) &&                            \
-		PyString_GET_SIZE(name) <= MCACHE_MAX_ATTR_SIZE
+		PyUnicode_CheckExact(name) &&                            \
+		PyUnicode_GET_SIZE(name) <= MCACHE_MAX_ATTR_SIZE
 
 struct method_cache_entry {
 	unsigned int version;