Skip to content

Commit ddddcbb

Browse files
scopdaviddrysdale
authored andcommitted
Make allcheck.py work with python3
1 parent 18b0e10 commit ddddcbb

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

tools/python/allcheck.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
from __future__ import print_function
23
import sys
34
import re
45
import glob
@@ -23,7 +24,7 @@
2324
for filename in glob.glob('../../python/phonenumbers/*.py'):
2425
if filename in INTERNAL_FILES:
2526
continue
26-
with file(filename, "r") as infile:
27+
with open(filename, "r") as infile:
2728
for line in infile:
2829
m = CLASS_RE.match(line)
2930
if m:
@@ -45,10 +46,10 @@
4546
code_not_grepped = (code_all - grepped_all)
4647
grepped_not_code = (grepped_all - code_all)
4748
if len(code_not_grepped) > 0:
48-
print >> sys.stderr, "Found the following in __all__ but not in grepped code:"
49+
print("Found the following in __all__ but not in grepped code:", file=sys.stderr)
4950
for identifier in code_not_grepped:
50-
print >> sys.stderr, " %s" % identifier
51+
print(" %s" % identifier, file=sys.stderr)
5152
if len(grepped_not_code) > 0:
52-
print >> sys.stderr, "Found the following in grepped code but not in __all__:"
53+
print("Found the following in grepped code but not in __all__:", file=sys.stderr)
5354
for identifier in grepped_not_code:
54-
print >> sys.stderr, " %s" % identifier
55+
print(" %s" % identifier, file=sys.stderr)

0 commit comments

Comments
 (0)