about summary refs log tree commit diff
path: root/src/etc/debugger_pretty_printers_common.py
diff options
context:
space:
mode:
authorgentoo90 <gentoo90@gmail.com>2017-06-09 19:09:02 +0300
committergentoo90 <gentoo90@gmail.com>2017-06-09 19:09:02 +0300
commit63076ddbb8e9856e9996adb49fc0a67a29ca697b (patch)
treec52cd711953e5aed7331eb349df9d097e017468f /src/etc/debugger_pretty_printers_common.py
parentd7c0d7569b47298da4a45dfd96275b9a888fe58c (diff)
downloadrust-63076ddbb8e9856e9996adb49fc0a67a29ca697b.tar.gz
rust-63076ddbb8e9856e9996adb49fc0a67a29ca697b.zip
Add compat_str() which works with unicode in both Python 2 and 3
GDB can be built with Python 2 or with Python 3
Diffstat (limited to 'src/etc/debugger_pretty_printers_common.py')
-rw-r--r--src/etc/debugger_pretty_printers_common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/debugger_pretty_printers_common.py b/src/etc/debugger_pretty_printers_common.py
index 7eb008a05f6..4a38d4be083 100644
--- a/src/etc/debugger_pretty_printers_common.py
+++ b/src/etc/debugger_pretty_printers_common.py
@@ -354,3 +354,8 @@ def extract_type_name(qualified_type_name):
         return qualified_type_name
     else:
         return qualified_type_name[index + 2:]
+
+try:
+    compat_str = unicode  # Python 2
+except NameError:
+    compat_str = str