summaryrefslogtreecommitdiffstats
path: root/Lib/pprint.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1997-04-18 13:54:13 (GMT)
committerFred Drake <fdrake@acm.org>1997-04-18 13:54:13 (GMT)
commit5fd026dc5eb993c703d6f76c5aa0ff81dd1d1753 (patch)
tree711894d2790bd08e72419e1759319f1a58ea0a44 /Lib/pprint.py
parentf39d0516b44c80fbcdbd7f8058bc2716224c127f (diff)
downloadcpython-5fd026dc5eb993c703d6f76c5aa0ff81dd1d1753.zip
cpython-5fd026dc5eb993c703d6f76c5aa0ff81dd1d1753.tar.gz
cpython-5fd026dc5eb993c703d6f76c5aa0ff81dd1d1753.tar.bz2
Fix a couple of glitches identified by Greg Stein.
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r--Lib/pprint.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index a16edb3..bf5133d 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -1,5 +1,3 @@
-# pprint.py
-#
# Author: Fred L. Drake, Jr.
# fdrake@cnri.reston.va.us, fdrake@acm.org
#
@@ -103,7 +101,7 @@ class PrettyPrinter:
level = level + 1
if context.has_key(id(object)):
object = _Recursion(object)
- rep = self__repr(object, context, level - 1)
+ rep = self.__repr(object, context, level - 1)
objid = id(object)
context[objid] = 1
typ = type(object)
@@ -115,7 +113,8 @@ class PrettyPrinter:
length = len(object)
if length:
indent = indent + self.__indent_per_level
- pprint(object[0], stream, indent, allowance + 1)
+ self.__format(object[0], stream, indent, allowance + 1,
+ context, level)
if len(object) > 1:
for ent in object[1:]:
stream.write(',\n' + ' '*indent)