summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwsgitools/digest.py8
-rw-r--r--wsgitools/scgi/asynchronous.py8
-rw-r--r--wsgitools/scgi/forkpool.py7
3 files changed, 5 insertions, 18 deletions
diff --git a/wsgitools/digest.py b/wsgitools/digest.py
index a4d2e4f..cbd374b 100755
--- a/wsgitools/digest.py
+++ b/wsgitools/digest.py
@@ -10,10 +10,6 @@ except ImportError:
import binascii
import base64
import time
-try:
- long
-except NameError:
- long = int
sysrand = random.SystemRandom()
@@ -135,7 +131,7 @@ def format_time(seconds):
@type seconds: float
@rtype: str
"""
- return "%13X" % long(seconds * 1000000)
+ return "%13X" % int(seconds * 1000000)
__all__.append("StatelessNonceStore")
class StatelessNonceStore(NonceStoreBase):
@@ -436,7 +432,7 @@ class AuthDigestMiddleware:
noncecount = 1
if credentials.get("qop") is not None:
# raises ValueError
- noncecount = long(credentials["nc"], 16)
+ noncecount = int(credentials["nc"], 16)
if not self.noncestore.checknonce(credentials["nonce"], noncecount):
return self.authorization_required(environ, start_response,
diff --git a/wsgitools/scgi/asynchronous.py b/wsgitools/scgi/asynchronous.py
index 33d5130..b51e7ca 100644
--- a/wsgitools/scgi/asynchronous.py
+++ b/wsgitools/scgi/asynchronous.py
@@ -10,10 +10,6 @@ except ImportError:
import cStringIO as io
except ImportError:
import StringIO as io
-try:
- long
-except NameError:
- long = int
class SCGIConnection(asyncore.dispatcher):
"""SCGI connection class used by L{SCGIServer}."""
@@ -83,7 +79,7 @@ class SCGIConnection(asyncore.dispatcher):
if not reqlen.isdigit():
self.close()
return # invalid request format
- reqlen = long(reqlen)
+ reqlen = int(reqlen)
if reqlen > self.maxrequestsize:
self.close()
return # request too long
@@ -110,7 +106,7 @@ class SCGIConnection(asyncore.dispatcher):
if not self.environ.get("CONTENT_LENGTH", "bad").isdigit():
self.close()
return
- self.reqlen = long(self.environ["CONTENT_LENGTH"])
+ self.reqlen = int(self.environ["CONTENT_LENGTH"])
if self.reqlen > self.maxpostsize:
self.close()
return
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index b913190..e6b65fd 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -11,11 +11,6 @@ import select
import sys
import errno
-try:
- long
-except NameError:
- long = int
-
class SocketFileWrapper:
"""Wraps a socket to a wsgi-compliant file-like object."""
def __init__(self, sock, toread):
@@ -374,7 +369,7 @@ class SCGIServer:
con.close()
return
- sfw = SocketFileWrapper(con, long(environ["CONTENT_LENGTH"]))
+ sfw = SocketFileWrapper(con, int(environ["CONTENT_LENGTH"]))
environ.update({
"wsgi.version": (1, 0),
"wsgi.input": sfw,