From be19ed77ddb047e02fe94d142181062af6d99dcc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 9 Feb 2007 05:37:30 +0000 Subject: 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.) --- Lib/sre_parse.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Lib/sre_parse.py') diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 2b3064b0ef..49dc080ed4 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -103,30 +103,30 @@ class SubPattern: nl = 1 seqtypes = type(()), type([]) for op, av in self.data: - print level*" " + op,; nl = 0 + print(level*" " + op, end=' '); nl = 0 if op == "in": # member sublanguage - print; nl = 1 + print(); nl = 1 for op, a in av: - print (level+1)*" " + op, a + print((level+1)*" " + op, a) elif op == "branch": - print; nl = 1 + print(); nl = 1 i = 0 for a in av[1]: if i > 0: - print level*" " + "or" + print(level*" " + "or") a.dump(level+1); nl = 1 i = i + 1 elif type(av) in seqtypes: for a in av: if isinstance(a, SubPattern): - if not nl: print + if not nl: print() a.dump(level+1); nl = 1 else: - print a, ; nl = 0 + print(a, end=' ') ; nl = 0 else: - print av, ; nl = 0 - if not nl: print + print(av, end=' ') ; nl = 0 + if not nl: print() def __repr__(self): return repr(self.data) def __len__(self): -- cgit v1.2.1