diff --git a/distutils/command/build_ext.py b/distutils/command/build_ext.py index f7ab32cfe1..22628baf90 100644 --- a/distutils/command/build_ext.py +++ b/distutils/command/build_ext.py @@ -220,7 +220,7 @@ def finalize_options(self): # For extensions under Cygwin, Python's library directory must be # appended to library_dirs if sys.platform[:6] == 'cygwin': - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + if not sysconfig.python_build: # building third party extensions self.library_dirs.append(os.path.join(sys.prefix, "lib", "python" + get_python_version(),