summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2014-02-12 10:11:18 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2014-02-12 10:11:18 -0500
commit970631432039ea05b0a67e208780753023b8e8ad (patch)
treec5da3a39aab15f7ff4134e1081148dc440734181
parent2562bd8951110c419d3a3321905a5d17236bcd72 (diff)
parent410d04255a204d180650eaf86890e1b389a36dbc (diff)
downloadpyopenssl-970631432039ea05b0a67e208780753023b8e8ad.tar.gz
Merge commit '410d042' into release-0.14 (Fix many tests on 64 bit Python on Windows)
-rw-r--r--OpenSSL/SSL.py9
-rw-r--r--OpenSSL/test/util.py6
-rw-r--r--runtests.py5
3 files changed, 13 insertions, 7 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(
diff --git a/OpenSSL/test/util.py b/OpenSSL/test/util.py
index 011e7da..4e4d812 100644
--- a/OpenSSL/test/util.py
+++ b/OpenSSL/test/util.py
@@ -17,7 +17,11 @@ import sys
from OpenSSL._util import exception_from_error_queue
from OpenSSL.crypto import Error
-import memdbg
+try:
+ import memdbg
+except Exception:
+ class _memdbg(object): heap = None
+ memdbg = _memdbg()
from OpenSSL._util import ffi, lib, byte_string as b
diff --git a/runtests.py b/runtests.py
index 2ec425b..13f5c4c 100644
--- a/runtests.py
+++ b/runtests.py
@@ -2,7 +2,10 @@ import sys
sys.modules['ssl'] = None
sys.modules['_hashlib'] = None
-import memdbg
+try:
+ import memdbg
+except Exception as e:
+ pass
from twisted.scripts.trial import run
run()