summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/checkpyc.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-03 17:06:41 (GMT)
commit6afaeb757af0dbd8508a0f2352ade61e41bec84c (patch)
treef1b31bc7138b17ff39791bbb45aa81583c3b6e46 /Tools/scripts/checkpyc.py
parente5d0e8431f929cad2da77b63fe1b7dc0ff21a428 (diff)
downloadcpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.zip
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.gz
cpython-6afaeb757af0dbd8508a0f2352ade61e41bec84c.tar.bz2
Convert print statements to function calls in Tools/.
Diffstat (limited to 'Tools/scripts/checkpyc.py')
-rwxr-xr-xTools/scripts/checkpyc.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py
index 8af7672..a38bc45 100755
--- a/Tools/scripts/checkpyc.py
+++ b/Tools/scripts/checkpyc.py
@@ -17,15 +17,15 @@ def main():
silent = 1
MAGIC = imp.get_magic()
if not silent:
- print 'Using MAGIC word', repr(MAGIC)
+ print('Using MAGIC word', repr(MAGIC))
for dirname in sys.path:
try:
names = os.listdir(dirname)
except os.error:
- print 'Cannot list directory', repr(dirname)
+ print('Cannot list directory', repr(dirname))
continue
if not silent:
- print 'Checking ', repr(dirname), '...'
+ print('Checking ', repr(dirname), '...')
names.sort()
for name in names:
if name[-3:] == '.py':
@@ -33,29 +33,29 @@ def main():
try:
st = os.stat(name)
except os.error:
- print 'Cannot stat', repr(name)
+ print('Cannot stat', repr(name))
continue
if verbose:
- print 'Check', repr(name), '...'
+ print('Check', repr(name), '...')
name_c = name + 'c'
try:
f = open(name_c, 'r')
except IOError:
- print 'Cannot open', repr(name_c)
+ print('Cannot open', repr(name_c))
continue
magic_str = f.read(4)
mtime_str = f.read(4)
f.close()
if magic_str <> MAGIC:
- print 'Bad MAGIC word in ".pyc" file',
- print repr(name_c)
+ print('Bad MAGIC word in ".pyc" file', end=' ')
+ print(repr(name_c))
continue
mtime = get_long(mtime_str)
if mtime == 0 or mtime == -1:
- print 'Bad ".pyc" file', repr(name_c)
+ print('Bad ".pyc" file', repr(name_c))
elif mtime <> st[ST_MTIME]:
- print 'Out-of-date ".pyc" file',
- print repr(name_c)
+ print('Out-of-date ".pyc" file', end=' ')
+ print(repr(name_c))
def get_long(s):
if len(s) <> 4: