Changed bytes object ob_sval cast to unsigned char * to prevent a RuntimeError with...
authorMark Florisson <markflorisson88@gmail.com>
Mon, 29 Nov 2010 23:28:53 +0000 (00:28 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Mon, 29 Nov 2010 23:28:53 +0000 (00:28 +0100)
Cython/Debugger/libcython.py
Cython/Debugger/libpython.py

index a6142ab59804a622580859895da2550bafbca551..07234e903de35d2b35752a1c1e4d72269394cddb 100644 (file)
@@ -578,13 +578,16 @@ class CyCy(CythonCommand):
         cy next
         cy run
         cy cont
+        cy finish
         cy up
         cy down
+        cy select
         cy bt / cy backtrace
-        cy print
         cy list
+        cy print
         cy locals
         cy globals
+        cy exec
     """
     
     name = 'cy'
index dfca4dda2ca276bf55326faa22f22a5275cc5a10..66242cf8e0cda2caf1ff6782bf9c2e98d537e41e 100644 (file)
@@ -48,6 +48,7 @@ from __future__ import with_statement
 import os
 import re
 import sys
+import struct
 import locale
 import atexit
 import warnings
@@ -1026,8 +1027,8 @@ class PyBytesObjectPtr(PyObjectPtr):
     def __str__(self):
         field_ob_size = self.field('ob_size')
         field_ob_sval = self.field('ob_sval')
-        char_ptr = field_ob_sval.address.cast(_type_unsigned_char_ptr)
-        return ''.join([chr(char_ptr[i]) for i in safe_range(field_ob_size)])
+        return ''.join(struct.pack('b', field_ob_sval[i]) 
+                           for i in safe_range(field_ob_size))
 
     def proxyval(self, visited):
         return str(self)