diff options
Diffstat (limited to 'lib/Crypto/SelfTest/Util/test_number.py')
-rw-r--r-- | lib/Crypto/SelfTest/Util/test_number.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/Crypto/SelfTest/Util/test_number.py b/lib/Crypto/SelfTest/Util/test_number.py index 834607b..709a774 100644 --- a/lib/Crypto/SelfTest/Util/test_number.py +++ b/lib/Crypto/SelfTest/Util/test_number.py @@ -325,16 +325,8 @@ def get_tests(config={}): from Crypto.PublicKey import _fastmath tests += list_test_cases(FastmathTests) 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"+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 "+ - "not being in the path. _fastmath was found at "+_fm_path) + from Crypto.SelfTest.st_common import handle_fastmath_import_error + handle_fastmath_import_error() return tests if __name__ == '__main__': |