22import re
33import sys
44
5- # This import is apparently needed for Nose on Red Hat's Python
6- import multiprocessing
7-
8- from distutils .command .build_ext import build_ext
9- from distutils .errors import CCompilerError , DistutilsExecError , DistutilsPlatformError
10-
115from setuptools import setup , Extension
6+ from setuptools .command .build_ext import build_ext
7+
8+ # These were only added to setuptools in 59.0.1.
9+ try :
10+ from setuptools .errors import CCompilerError
11+ from setuptools .errors import DistutilsExecError
12+ from setuptools .errors import DistutilsPlatformError
13+ except ImportError :
14+ from distutils .errors import CCompilerError
15+ from distutils .errors import DistutilsExecError
16+ from distutils .errors import DistutilsPlatformError
1217
1318cmdclass = {}
1419PYPY = hasattr (sys , "pypy_version_info" )
3338
3439class BuildFailed (Exception ):
3540 def __init__ (self ):
36- self .cause = sys .exc_info ()[1 ] # work around py 2/3 different syntax
41+ self .cause = sys .exc_info ()[1 ]
3742
3843
3944class ve_build_ext (build_ext ):
@@ -52,7 +57,7 @@ def build_extension(self, ext):
5257 raise BuildFailed ()
5358 except ValueError :
5459 # this can happen on Windows 64 bit, see Python issue 7511
55- if "'path'" in str (sys .exc_info ()[1 ]): # works with both py 2/3
60+ if "'path'" in str (sys .exc_info ()[1 ]):
5661 raise BuildFailed ()
5762 raise
5863
@@ -112,8 +117,6 @@ def run_setup(with_cext):
112117 python_requires = ">=3.6" ,
113118 include_package_data = True ,
114119 install_requires = requirements ,
115- tests_require = ["nose" ],
116- test_suite = "nose.collector" ,
117120 license = LICENSE ,
118121 cmdclass = cmdclass ,
119122 classifiers = [
@@ -127,6 +130,7 @@ def run_setup(with_cext):
127130 "Programming Language :: Python :: 3.7" ,
128131 "Programming Language :: Python :: 3.8" ,
129132 "Programming Language :: Python :: 3.9" ,
133+ "Programming Language :: Python :: 3.10" ,
130134 "Programming Language :: Python" ,
131135 "Topic :: Internet :: Proxy Servers" ,
132136 "Topic :: Internet" ,
0 commit comments