summaryrefslogtreecommitdiff
path: root/OpenSSL/SSL.py
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-02-02 06:45:21 -0800
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-02-02 06:45:21 -0800
commit600dcc2e8ba0d02f19b68e84e1dc07a50cad83d2 (patch)
tree0e64b3b03c3e76d9c7158314bdaf7c7fbf5f9fb3 /OpenSSL/SSL.py
parentce27d79ec1d93dd428d09f5e6df79b12534423a3 (diff)
parent410d04255a204d180650eaf86890e1b389a36dbc (diff)
downloadpyopenssl-600dcc2e8ba0d02f19b68e84e1dc07a50cad83d2.tar.gz
Merge pull request #20 from kouk/longint
Add support for file descriptors represented as `long` on Python 2.x. This fixes many failing tests on 64 bit Windows w/ 64 bit Python. Also some other changes to make `memdbg` optional (it is pretty glibc-specific).
Diffstat (limited to 'OpenSSL/SSL.py')
-rw-r--r--OpenSSL/SSL.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 811c4de..81ec2e2 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -5,7 +5,7 @@ from weakref import WeakValueDictionary
from errno import errorcode
from six import text_type as _text_type
-
+from six import integer_types as integer_types
from OpenSSL._util import (
ffi as _ffi,
@@ -196,16 +196,15 @@ class _VerifyHelper(object):
def _asFileDescriptor(obj):
fd = None
-
- if not isinstance(obj, int):
+ if not isinstance(obj, integer_types):
meth = getattr(obj, "fileno", None)
if meth is not None:
obj = meth()
- if isinstance(obj, int):
+ if isinstance(obj, integer_types):
fd = obj
- if not isinstance(fd, int):
+ if not isinstance(fd, integer_types):
raise TypeError("argument must be an int, or have a fileno() method.")
elif fd < 0:
raise ValueError(