summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2016-05-26 17:28:13 +0300
committerDavid Drysdale <dmd@lurklurk.org>2016-05-27 10:21:46 +0100
commitddddcbb10abfc95c24d5df2ec16a4c4152cba1d3 (patch)
tree45319fd8b1acdfe2d010ad6995b44a938423b3ad /tools
parent18b0e10b5a94f70bcb83ba767dbe0210a8b7cd92 (diff)
Make allcheck.py work with python3
Diffstat (limited to 'tools')
-rwxr-xr-xtools/python/allcheck.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/python/allcheck.py b/tools/python/allcheck.py
index f9107aef..af7e794b 100755
--- a/tools/python/allcheck.py
+++ b/tools/python/allcheck.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import sys
import re
import glob
@@ -23,7 +24,7 @@ grepped_all = set()
for filename in glob.glob('../../python/phonenumbers/*.py'):
if filename in INTERNAL_FILES:
continue
- with file(filename, "r") as infile:
+ with open(filename, "r") as infile:
for line in infile:
m = CLASS_RE.match(line)
if m:
@@ -45,10 +46,10 @@ code_all = (set(phonenumbers.__all__) |
code_not_grepped = (code_all - grepped_all)
grepped_not_code = (grepped_all - code_all)
if len(code_not_grepped) > 0:
- print >> sys.stderr, "Found the following in __all__ but not in grepped code:"
+ print("Found the following in __all__ but not in grepped code:", file=sys.stderr)
for identifier in code_not_grepped:
- print >> sys.stderr, " %s" % identifier
+ print(" %s" % identifier, file=sys.stderr)
if len(grepped_not_code) > 0:
- print >> sys.stderr, "Found the following in grepped code but not in __all__:"
+ print("Found the following in grepped code but not in __all__:", file=sys.stderr)
for identifier in grepped_not_code:
- print >> sys.stderr, " %s" % identifier
+ print(" %s" % identifier, file=sys.stderr)