summaryrefslogtreecommitdiffstats
path: root/Lib/pickletools.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/pickletools.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/pickletools.py')
-rw-r--r--Lib/pickletools.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 8b255b9..846172a 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -1757,18 +1757,18 @@ def assure_pickle_consistency(verbose=False):
for name in pickle.__all__:
if not re.match("[A-Z][A-Z0-9_]+$", name):
if verbose:
- print "skipping %r: it doesn't look like an opcode name" % name
+ print("skipping %r: it doesn't look like an opcode name" % name)
continue
picklecode = getattr(pickle, name)
if not isinstance(picklecode, str) or len(picklecode) != 1:
if verbose:
- print ("skipping %r: value %r doesn't look like a pickle "
- "code" % (name, picklecode))
+ print(("skipping %r: value %r doesn't look like a pickle "
+ "code" % (name, picklecode)))
continue
if picklecode in copy:
if verbose:
- print "checking name %r w/ code %r for consistency" % (
- name, picklecode)
+ print("checking name %r w/ code %r for consistency" % (
+ name, picklecode))
d = copy[picklecode]
if d.name != name:
raise ValueError("for pickle code %r, pickle.py uses name %r "
@@ -1899,7 +1899,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
errormsg = None
for opcode, arg, pos in genops(pickle):
if pos is not None:
- print >> out, "%5d:" % pos,
+ print("%5d:" % pos, end=' ', file=out)
line = "%-4s %s%s" % (repr(opcode.code)[1:-1],
indentchunk * len(markstack),
@@ -1964,7 +1964,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
line += ' ' + repr(arg)
if markmsg:
line += ' ' + markmsg
- print >> out, line
+ print(line, file=out)
if errormsg:
# Note that we delayed complaining until the offending opcode
@@ -1983,7 +1983,7 @@ def dis(pickle, out=None, memo=None, indentlevel=4):
stack.extend(after)
- print >> out, "highest protocol among opcodes =", maxproto
+ print("highest protocol among opcodes =", maxproto, file=out)
if stack:
raise ValueError("stack not empty after STOP: %r" % stack)