changeset 33669:7686cbb0ba41 stable

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
author Mike Hommey <mh@glandium.org>
date Fri, 11 Aug 2017 10:16:00 +0900
parents 8de8f8a91f2d
children 3889cf955a62
files setup.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Thu Aug 10 21:25:02 2017 -0400
+++ b/setup.py	Fri Aug 11 10:16:00 2017 +0900
@@ -784,11 +784,11 @@
     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 @@
     # 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')