[Python-checkins] r58358 - python/branches/alex-py3k/Modules/_picklemodule.c

alexandre.vassalotti python-checkins at python.org
Mon Oct 8 03:58:06 CEST 2007


Author: alexandre.vassalotti
Date: Mon Oct  8 03:58:06 2007
New Revision: 58358

Modified:
   python/branches/alex-py3k/Modules/_picklemodule.c
Log:
In save_string(), use PyUnicode API for handling object's repr.


Modified: python/branches/alex-py3k/Modules/_picklemodule.c
==============================================================================
--- python/branches/alex-py3k/Modules/_picklemodule.c	(original)
+++ python/branches/alex-py3k/Modules/_picklemodule.c	Mon Oct  8 03:58:06 2007
@@ -948,9 +948,9 @@
         if (!(repr = PyObject_Repr(args)))
             return -1;
 
-        if ((len = PyString_Size(repr)) < 0)
+        if ((len = PyUnicode_GetSize(repr)) < 0)
             goto error;
-        repr_str = PyString_AS_STRING((PyStringObject *)repr);
+        repr_str = PyUnicode_AsString(repr);
 
         if (self->write_func(self, &string, 1) < 0)
             goto error;
@@ -988,7 +988,7 @@
             return -1;
 
         if (self->write_func(self,
-                             PyString_AS_STRING((PyStringObject *)args),
+                             PyString_AS_STRING(args),
                              size) < 0)
             return -1;
     }


More information about the Python-checkins mailing list