mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
This commit is contained in:
parent
a8c360ee76
commit
6f2df4d5e1
132 changed files with 1070 additions and 1080 deletions
|
@ -3,11 +3,11 @@ class Security:
|
|||
def __init__(self):
|
||||
import os
|
||||
env = os.environ
|
||||
if env.has_key('PYTHON_KEYFILE'):
|
||||
if 'PYTHON_KEYFILE' in env:
|
||||
keyfile = env['PYTHON_KEYFILE']
|
||||
else:
|
||||
keyfile = '.python_keyfile'
|
||||
if env.has_key('HOME'):
|
||||
if 'HOME' in env:
|
||||
keyfile = os.path.join(env['HOME'], keyfile)
|
||||
if not os.path.exists(keyfile):
|
||||
import sys
|
||||
|
@ -19,7 +19,7 @@ class Security:
|
|||
try:
|
||||
self._key = eval(open(keyfile).readline())
|
||||
except IOError:
|
||||
raise IOError, "python keyfile %s: cannot open" % keyfile
|
||||
raise IOError("python keyfile %s: cannot open" % keyfile)
|
||||
|
||||
def _generate_challenge(self):
|
||||
import random
|
||||
|
@ -30,4 +30,4 @@ class Security:
|
|||
|
||||
def _encode_challenge(self, challenge):
|
||||
p, m = self._key
|
||||
return pow(long(challenge), p, m)
|
||||
return pow(int(challenge), p, m)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue