summaryrefslogtreecommitdiff
path: root/Cython/Debugger/libpython.py
diff options
context:
space:
mode:
authorMark Florisson <markflorisson88@gmail.com>2010-12-05 14:58:29 +0100
committerMark Florisson <markflorisson88@gmail.com>2010-12-05 14:58:29 +0100
commit5dc75a83774a4edb809e891edca83886029a9c66 (patch)
tree97a3d1fa301ccf929e6e3e7d17341c1c0b7f75f8 /Cython/Debugger/libpython.py
parentc8376239fb3288d6fdb02a7c6e2b15c6211caf6f (diff)
downloadcython-5dc75a83774a4edb809e891edca83886029a9c66.tar.gz
Made tests less verbose by not using distutils.core.setup + skip debugger tests when gdb < 7.2 or not available
Diffstat (limited to 'Cython/Debugger/libpython.py')
-rw-r--r--Cython/Debugger/libpython.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Cython/Debugger/libpython.py b/Cython/Debugger/libpython.py
index 07a57a49c..b871756ee 100644
--- a/Cython/Debugger/libpython.py
+++ b/Cython/Debugger/libpython.py
@@ -59,9 +59,13 @@ import itertools
import gdb
-# I think this is the only way to fix this bug :'(
-# http://sourceware.org/bugzilla/show_bug.cgi?id=12285
-reload(sys).setdefaultencoding('UTF-8')
+if sys.version_info[0] < 3:
+ # I think this is the only way to fix this bug :'(
+ # http://sourceware.org/bugzilla/show_bug.cgi?id=12285
+ out, err = sys.stdout, sys.stderr
+ reload(sys).setdefaultencoding('UTF-8')
+ sys.stdout = out
+ sys.stderr = err
# Look up the gdb.Type for some standard types:
_type_char_ptr = gdb.lookup_type('char').pointer() # char*