diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index ad231631bb46e1..ad3caf86529fb1 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -218,7 +218,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.platform[:6] == 'cygwin' or self.plat_name.startswith(('mingw')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions config_dir_name = os.path.basename(sysconfig.get_config_var('LIBPL'))