Apparently that code is a no-go on Python 2. It seemed to work on Python 3 though.
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index d62ce84..c48c84f 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -5,7 +5,8 @@
from six import (
integer_types as _integer_types,
- text_type as _text_type)
+ text_type as _text_type,
+ PY3 as _PY3)
from OpenSSL._util import (
ffi as _ffi,
@@ -274,10 +275,11 @@
"""
_curves = None
- def __ne__(self, other):
- if isinstance(other, _EllipticCurve):
- return super(_EllipticCurve, self).__ne__(other)
- return NotImplemented
+ if _PY3:
+ def __ne__(self, other):
+ if isinstance(other, _EllipticCurve):
+ return super(_EllipticCurve, self).__ne__(other)
+ return NotImplemented
@classmethod