diff options
Diffstat (limited to 'Demo/comparisons/regextest.py')
-rwxr-xr-x | Demo/comparisons/regextest.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Demo/comparisons/regextest.py b/Demo/comparisons/regextest.py index 1fab052..d2c534d 100755 --- a/Demo/comparisons/regextest.py +++ b/Demo/comparisons/regextest.py @@ -21,7 +21,7 @@ import sys import re def main(): - pats = map(chomp, sys.stdin.readlines()) + pats = list(map(chomp, sys.stdin.readlines())) bigpat = '(' + '|'.join(pats) + ')' prog = re.compile(bigpat) @@ -29,7 +29,7 @@ def main(): try: fp = open(file, 'r') except IOError as msg: - print "%s: %s" % (file, msg) + print("%s: %s" % (file, msg)) continue lineno = 0 while 1: @@ -38,7 +38,7 @@ def main(): break lineno = lineno + 1 if prog.search(line): - print "%s:%s:%s" % (file, lineno, line), + print("%s:%s:%s" % (file, lineno, line), end=' ') def chomp(s): return s.rstrip('\n') |