diff options
author | Helmut Grohne <helmut@subdivi.de> | 2009-03-29 17:42:48 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2009-03-29 17:42:48 +0200 |
commit | 5c0a3965cdb9cac87d0b0ea773a6276c73a27ba6 (patch) | |
tree | 56619fbd0631ae08e01adca15e2994c689dfe8b4 /wsgitools/digest.py | |
parent | ac99754f5e68f3731b7bdd7c8070c58346983bf4 (diff) | |
download | wsgitools-5c0a3965cdb9cac87d0b0ea773a6276c73a27ba6.tar.gz |
quite some changes for py3
These changes introduce some compatibility code. They don't make
wsgitools usable with Python 3.0, but they also don't break
compatibility with Python 2.5.
Diffstat (limited to 'wsgitools/digest.py')
-rwxr-xr-x | wsgitools/digest.py | 8 |
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: |