[pypy-svn] r46142 - pypy/branch/pypy-more-rtti-inprogress/translator/tool

arigo at codespeak.net arigo at codespeak.net
Wed Aug 29 12:17:12 CEST 2007


Author: arigo
Date: Wed Aug 29 12:17:11 2007
New Revision: 46142

Modified:
   pypy/branch/pypy-more-rtti-inprogress/translator/tool/cbuild.py
Log:
Win/Py2.4: workaround for a distutils bugs where some env vars can
become longer and longer every time it is used


Modified: pypy/branch/pypy-more-rtti-inprogress/translator/tool/cbuild.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/translator/tool/cbuild.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/translator/tool/cbuild.py	Wed Aug 29 12:17:11 2007
@@ -346,7 +346,9 @@
 
     def build(self, noerr=False):
         basename = self.outputfilename.new(ext='')
+        data = ''
         try:
+            saved_environ = os.environ.copy()
             try:
                 c = stdoutcapture.Capture(mixed_out_err = True)
                 if self.profbased is None:
@@ -362,6 +364,11 @@
                     profdrv.probe(str(self.outputfilename),args)
                     profdrv.after()
             finally:
+                # workaround for a distutils bugs where some env vars can
+                # become longer and longer every time it is used
+                for key, value in saved_environ.items():
+                    if os.environ.get(key) != value:
+                        os.environ[key] = value
                 foutput, foutput = c.done()
                 data = foutput.read()
                 if data:



More information about the Pypy-commit mailing list