[pypy-commit] pypy default: make the pretty prints a bit shorter

antocuni noreply at buildbot.pypy.org
Mon Aug 8 17:39:17 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r46376:524340460604
Date: 2011-08-08 17:28 +0200
http://bitbucket.org/pypy/pypy/changeset/524340460604/

Log:	make the pretty prints a bit shorter

diff --git a/pypy/tool/gdb_pypy.py b/pypy/tool/gdb_pypy.py
--- a/pypy/tool/gdb_pypy.py
+++ b/pypy/tool/gdb_pypy.py
@@ -153,7 +153,7 @@
         items = chars['items']
         res = [chr(items[i]) for i in range(length)]
         string = ''.join(res)
-        return repr(string) + " (rpy)"
+        return 'r' + repr(string)
 
 
 class RPyListPrinter(object):
@@ -185,7 +185,7 @@
             item = items[i]
             itemlist.append(str(item))
         str_items = ', '.join(itemlist)
-        return '[%s] (length=%d, allocated=%d, rpy)' % (str_items, length, allocated)
+        return 'r[%s] (len=%d, alloc=%d)' % (str_items, length, allocated)
 
 
 try:
diff --git a/pypy/tool/test/test_gdb_pypy.py b/pypy/tool/test/test_gdb_pypy.py
--- a/pypy/tool/test/test_gdb_pypy.py
+++ b/pypy/tool/test/test_gdb_pypy.py
@@ -155,7 +155,7 @@
          }
     p_string = PtrValue(d, type_tag='pypy_rpy_string0')
     printer = gdb_pypy.RPyStringPrinter.lookup(p_string, FakeGdb)
-    assert printer.to_string() == "'foobar' (rpy)"
+    assert printer.to_string() == "r'foobar'"
 
 def test_pprint_list():
     d = {'_gcheader': {
@@ -173,4 +173,4 @@
          }
     mylist = PtrValue(d, type_tag='pypy_list0')
     printer = gdb_pypy.RPyListPrinter.lookup(mylist, FakeGdb)
-    assert printer.to_string() == '[40, 41, 42] (length=3, allocated=5, rpy)'
+    assert printer.to_string() == 'r[40, 41, 42] (len=3, alloc=5)'


More information about the pypy-commit mailing list