--- lib/Crypto/SelfTest/PublicKey/test_DSA.py +++ lib/Crypto/SelfTest/PublicKey/test_DSA.py @@ -223,7 +223,7 @@ def get_tests(config={}): from Crypto.PublicKey import _fastmath tests += list_test_cases(DSAFastMathTest) except ImportError: - from distutils.sysconfig import get_config_var + from sysconfig import get_config_var import inspect _fm_path = os.path.normpath(os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) --- lib/Crypto/SelfTest/PublicKey/test_RSA.py +++ lib/Crypto/SelfTest/PublicKey/test_RSA.py @@ -393,7 +393,7 @@ def get_tests(config={}): from Crypto.PublicKey import _fastmath tests += list_test_cases(RSAFastMathTest) except ImportError: - from distutils.sysconfig import get_config_var + from sysconfig import get_config_var import inspect _fm_path = os.path.normpath(os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) --- lib/Crypto/Util/number.py +++ lib/Crypto/Util/number.py @@ -41,7 +41,7 @@ except ImportError: # see an exception raised if _fastmath exists but cannot be imported, # uncomment the below # - # from distutils.sysconfig import get_config_var + # from sysconfig import get_config_var # import inspect, os # _fm_path = os.path.normpath(os.path.dirname(os.path.abspath( # inspect.getfile(inspect.currentframe()))) --- setup.py +++ setup.py @@ -1,6 +1,6 @@ #! /usr/bin/env python # -# setup.py : Distutils setup script +# setup.py : setuptools setup script # # Part of the Python Cryptography Toolkit # @@ -36,11 +36,10 @@ __revision__ = "$Id$" -from distutils import core -from distutils.ccompiler import new_compiler -from distutils.core import Extension, Command -from distutils.command.build import build -from distutils.command.build_ext import build_ext +from setuptools import setup +from setuptools.command.build_ext import new_compiler +from setuptools import Extension, Command +from setuptools.command.build_ext import build_ext import os, sys, re import struct @@ -53,8 +52,7 @@ if sys.version[0:1] != '3': # .gcov files USE_GCOV = 0 - -from distutils.command.build_py import build_py +from setuptools.command.build_py import build_py # Work around the print / print() issue with Python 2.x and 3.x. We only need # to print at one point of the code, which makes this easy @@ -385,7 +383,7 @@ kw = {'name':"pycrypto", ] } -core.setup(**kw) +setup(**kw) def touch(path): import os, time