Author: Antonio Cuni <[email protected]>
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)'
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit