summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Abramowitz <marc@marc-abramowitz.com>2013-11-11 21:57:06 +0000
committerDwayne Litzenberger <dlitz@dlitz.net>2014-02-22 12:40:25 -0800
commit5dc0db200952fe4ea65e4100f4e0c1a2bb79b9f2 (patch)
treebfd62a98b2afcaf5e96be2ad016725e61959ec78
parentda8b67318c657af432001c1b425fd8ab5e5879ab (diff)
downloadpycrypto-5dc0db200952fe4ea65e4100f4e0c1a2bb79b9f2.tar.gz
Use different method for getting ext_suffix
``` ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO") ``` because `get_config_var("SO")` returns None in Python 3.4.0a4 because the "SO" variable is deprecated and "EXT_SUFFIX" is the new way to get this information (see: http://bugs.python.org/issue19555) This fixes `TypeError: Can't convert 'NoneType' object to str implicitly` errors when running the tests on Python 3.4.0a4.
-rw-r--r--lib/Crypto/SelfTest/PublicKey/test_DSA.py3
-rw-r--r--lib/Crypto/SelfTest/PublicKey/test_RSA.py3
-rw-r--r--lib/Crypto/SelfTest/Util/test_number.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/Crypto/SelfTest/PublicKey/test_DSA.py b/lib/Crypto/SelfTest/PublicKey/test_DSA.py
index b05f69a..72b9e95 100644
--- a/lib/Crypto/SelfTest/PublicKey/test_DSA.py
+++ b/lib/Crypto/SelfTest/PublicKey/test_DSA.py
@@ -227,9 +227,10 @@ def get_tests(config={}):
except ImportError:
from distutils.sysconfig import get_config_var
import inspect
+ ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO")
_fm_path = os.path.normpath(os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
- +"/../../PublicKey/_fastmath"+get_config_var("SO"))
+ +"/../../PublicKey/_fastmath"+ext_suffix)
if os.path.exists(_fm_path):
raise ImportError("While the _fastmath module exists, importing "+
"it failed. This may point to the gmp or mpir shared library "+
diff --git a/lib/Crypto/SelfTest/PublicKey/test_RSA.py b/lib/Crypto/SelfTest/PublicKey/test_RSA.py
index 2884317..15f2a4f 100644
--- a/lib/Crypto/SelfTest/PublicKey/test_RSA.py
+++ b/lib/Crypto/SelfTest/PublicKey/test_RSA.py
@@ -463,9 +463,10 @@ def get_tests(config={}):
except ImportError:
from distutils.sysconfig import get_config_var
import inspect
+ ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO")
_fm_path = os.path.normpath(os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
- +"/../../PublicKey/_fastmath"+get_config_var("SO"))
+ +"/../../PublicKey/_fastmath"+ext_suffix)
if os.path.exists(_fm_path):
raise ImportError("While the _fastmath module exists, importing "+
"it failed. This may point to the gmp or mpir shared library "+
diff --git a/lib/Crypto/SelfTest/Util/test_number.py b/lib/Crypto/SelfTest/Util/test_number.py
index 2201a93..834607b 100644
--- a/lib/Crypto/SelfTest/Util/test_number.py
+++ b/lib/Crypto/SelfTest/Util/test_number.py
@@ -327,9 +327,10 @@ def get_tests(config={}):
except ImportError:
from distutils.sysconfig import get_config_var
import inspect, os.path
+ ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO")
_fm_path = os.path.normpath(os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
- +"/../../PublicKey/_fastmath"+get_config_var("SO"))
+ +"/../../PublicKey/_fastmath"+ext_suffix)
if os.path.exists(_fm_path):
raise ImportError("While the _fastmath module exists, importing "+
"it failed. This may point to the gmp or mpir shared library "+