diff options
Diffstat (limited to 'Demo/pdist/security.py')
-rwxr-xr-x | Demo/pdist/security.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Demo/pdist/security.py b/Demo/pdist/security.py index b63081e..ffdbe2d 100755 --- a/Demo/pdist/security.py +++ b/Demo/pdist/security.py @@ -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) |