summaryrefslogtreecommitdiff
path: root/wsgitools/digest.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-xwsgitools/digest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index d99f67d..a4d2e4f 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -10,6 +10,10 @@ except ImportError:
import binascii
import base64
import time
+try:
+ long
+except NameError:
+ long = int
sysrand = random.SystemRandom()
@@ -33,7 +37,7 @@ def parse_digest_response(data, ret=dict()):
>>> try:
... parse_digest_response('spam')
... except ValueError:
- ... print "ValueError"
+ ... print("ValueError")
ValueError
"""
data = data.strip()
@@ -45,7 +49,7 @@ def parse_digest_response(data, ret=dict()):
ret[key] = value
return ret
if rest[0] != ',':
- raise ValueError, "invalid digest response"
+ raise ValueError("invalid digest response")
rest = rest[1:]
else:
if ',' not in rest: