diff options
| author | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 +0000 | 
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 +0000 | 
| commit | be19ed77ddb047e02fe94d142181062af6d99dcc (patch) | |
| tree | 70f214e06554046fcccbadeb78665f25e07ce965 /Lib/sre_parse.py | |
| parent | 452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff) | |
| download | cpython-git-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz | |
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/sre_parse.py')
| -rw-r--r-- | Lib/sre_parse.py | 18 | 
1 files changed, 9 insertions, 9 deletions
| 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): | 
