support 64 bit fd's
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index ce2cc29..3a0d751 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -196,16 +196,15 @@
def _asFileDescriptor(obj):
fd = None
-
- if not isinstance(obj, int):
+ if not isinstance(obj, (int, long)):
meth = getattr(obj, "fileno", None)
if meth is not None:
obj = meth()
- if isinstance(obj, int):
+ if isinstance(obj, (int, long)):
fd = obj
- if not isinstance(fd, int):
+ if not isinstance(fd, (int, long)):
raise TypeError("argument must be an int, or have a fileno() method.")
elif fd < 0:
raise ValueError(