150
150
def _check_output (* args , ** kwargs ):
151
151
"""Check output wrapper for py2/py3 compatibility"""
152
152
output = subprocess .check_output (* args , ** kwargs )
153
- if PY_MAJOR == 2 :
154
- return output
155
153
return output .decode ("ascii" )
156
154
157
155
@@ -255,17 +253,11 @@ def build_extension(self, ext):
255
253
256
254
# Up to Python 3.2 sys.maxunicode is used to determine the size of
257
255
# Py_UNICODE, but from 3.3 onwards Py_UNICODE is a typedef of wchar_t.
258
- # TODO: Is this doing the right check for Py27?
259
- if sys .version_info [:2 ] <= (3 , 2 ):
260
- unicode_width = 2 if sys .maxunicode < 0x10FFFF else 4
261
- else :
262
- import ctypes
263
-
264
- unicode_width = ctypes .sizeof (ctypes .c_wchar )
256
+ import ctypes
257
+ unicode_width = ctypes .sizeof (ctypes .c_wchar )
265
258
266
259
defines = [
267
260
"PYTHON{0}{1}" .format (PY_MAJOR , PY_MINOR ),
268
- "PYTHON{0}" .format (PY_MAJOR ), # Python Major Version
269
261
"UCS{0}" .format (unicode_width ),
270
262
]
271
263
@@ -274,7 +266,6 @@ def build_extension(self, ext):
274
266
275
267
if sys .platform != "win32" and (DEVTOOLS == "Mono" or DEVTOOLS == "dotnet" ):
276
268
on_darwin = sys .platform == "darwin"
277
- defines .append ("MONO_OSX" if on_darwin else "MONO_LINUX" )
278
269
279
270
# Check if --enable-shared was set when Python was built
280
271
enable_shared = sysconfig .get_config_var ("Py_ENABLE_SHARED" )
@@ -288,6 +279,9 @@ def build_extension(self, ext):
288
279
if not enable_shared :
289
280
defines .append ("PYTHON_WITHOUT_ENABLE_SHARED" )
290
281
282
+ if sys .platform == "win32" :
283
+ defines .append ("WINDOWS" )
284
+
291
285
if hasattr (sys , "abiflags" ):
292
286
if "d" in sys .abiflags :
293
287
defines .append ("PYTHON_WITH_PYDEBUG" )
@@ -479,10 +473,7 @@ def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False):
479
473
return path
480
474
481
475
# Search within registry to find build tools
482
- try : # PY2
483
- import _winreg as winreg
484
- except ImportError : # PY3
485
- import winreg
476
+ import winreg
486
477
487
478
_collect_installed_windows_kits_v10 (winreg )
488
479
@@ -645,8 +636,6 @@ def run(self):
645
636
"Intended Audience :: Developers" ,
646
637
"License :: OSI Approved :: MIT License" ,
647
638
"Programming Language :: C#" ,
648
- "Programming Language :: Python :: 2" ,
649
- "Programming Language :: Python :: 2.7" ,
650
639
"Programming Language :: Python :: 3" ,
651
640
"Programming Language :: Python :: 3.5" ,
652
641
"Programming Language :: Python :: 3.6" ,
0 commit comments