summaryrefslogtreecommitdiffstats
path: root/Demo/scripts/eqfix.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/scripts/eqfix.py
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/scripts/eqfix.py')
-rwxr-xr-xDemo/scripts/eqfix.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Demo/scripts/eqfix.py b/Demo/scripts/eqfix.py
index 497ab20..47c00d3 100755
--- a/Demo/scripts/eqfix.py
+++ b/Demo/scripts/eqfix.py
@@ -143,7 +143,7 @@ def fix(filename):
# First copy the file's mode to the temp file
try:
statbuf = os.stat(filename)
- os.chmod(tempname, statbuf[ST_MODE] & 07777)
+ os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
except os.error as msg:
err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
# Then make a backup of the original file as filename~
@@ -176,22 +176,22 @@ def fixline(line):
j = tokenprog.match(line, i)
if j < 0:
# A bad token; forget about the rest of this line
- print '(Syntax error:)'
- print line,
+ print('(Syntax error:)')
+ print(line, end=' ')
return line
a, b = tokenprog.regs[3] # Location of the token proper
token = line[a:b]
i = i+j
if stack and token == stack[-1]:
del stack[-1]
- elif match.has_key(token):
+ elif token in match:
stack.append(match[token])
elif token == '=' and stack:
line = line[:a] + '==' + line[b:]
i, n = a + len('=='), len(line)
elif token == '==' and not stack:
- print '(Warning: \'==\' at top level:)'
- print line,
+ print('(Warning: \'==\' at top level:)')
+ print(line, end=' ')
return line
if __name__ == "__main__":