# HG changeset patch # User Mike Hommey # Date 2017-08-11 01:16:00 # Node ID 7686cbb0ba4138c56d038d8d82ccc052bf9b60d7 # Parent 8de8f8a91f2d8fc84733896d3a7056f974a99e04 setup: fix installing in a mingw environment The addition, in 9a4adc76c88a, of a hack for the MSVC compiler class was overwriting the original class for the Mingw32CCompiler class, leading to an error when the HackedMingw32CCompiler is instantiated. Differential Revision: https://phab.mercurial-scm.org/D329 diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -784,11 +784,11 @@ try: from distutils import cygwinccompiler # the -mno-cygwin option has been deprecated for years - compiler = cygwinccompiler.Mingw32CCompiler + mingw32compilerclass = cygwinccompiler.Mingw32CCompiler class HackedMingw32CCompiler(cygwinccompiler.Mingw32CCompiler): def __init__(self, *args, **kwargs): - compiler.__init__(self, *args, **kwargs) + mingw32compilerclass.__init__(self, *args, **kwargs) for i in 'compiler compiler_so linker_exe linker_so'.split(): try: getattr(self, i).remove('-mno-cygwin') @@ -809,11 +809,11 @@ if os.name == 'nt': # effect. from distutils import msvccompiler - compiler = msvccompiler.MSVCCompiler + msvccompilerclass = msvccompiler.MSVCCompiler class HackedMSVCCompiler(msvccompiler.MSVCCompiler): def initialize(self): - compiler.initialize(self) + msvccompilerclass.initialize(self) # "warning LNK4197: export 'func' specified multiple times" self.ldflags_shared.append('/ignore:4197') self.ldflags_shared_debug.append('/ignore:4197')