Skip to content

Commit 2fcd519

Browse files
committed
try using it directly instead of import
1 parent e29951c commit 2fcd519

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ def determine_generator_args():
7575
if sys.platform == 'win32':
7676
try:
7777
# See which compiler python picks
78-
from setuptools._distutils import ccompiler # We use ccompiler on windows to determine the msvc version
79-
compiler = ccompiler.new_compiler()
80-
compiler.initialize()
78+
compiler = setuptools._distutils.ccompiler.new_compiler()
8179

8280
# Look at compiler path to divine the Visual Studio version.
8381
# This technique may not work with customized VS install paths.
@@ -324,7 +322,6 @@ def awscrt_ext():
324322
libraries.reverse()
325323

326324
if sys.platform == 'win32':
327-
from setuptools._distutils import ccompiler # We use ccompiler on windows to determine the msvc version
328325
# the windows apis being used under the hood. Since we're static linking we have to follow the entire chain down
329326
libraries += ['Secur32', 'Crypt32', 'Advapi32', 'NCrypt', 'BCrypt', 'Kernel32', 'Ws2_32', 'Shlwapi']
330327
# Ensure that debug info is in the obj files, and that it is linked into the .pyd so that
@@ -373,7 +370,7 @@ def awscrt_ext():
373370
# rare cases where that didn't happen, so let's be explicit.
374371
extra_link_args += ['-pthread']
375372

376-
if sys.platform != 'win32' or ccompiler.get_default_compiler() != 'msvc':
373+
if sys.platform != 'win32' or setuptools._distutils.ccompiler.get_default_compiler() != 'msvc':
377374
extra_compile_args += ['-Wno-strict-aliasing', '-std=gnu99']
378375

379376
# treat warnings as errors in development mode

0 commit comments

Comments
 (0)