Hi Armin,

I dodn't understand completely why this patch is needed:

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py (original)
+++ pypy/dist/pypy/translator/geninterplevel.py Sat May 21 14:19:31 2005
@@ -77,7 +77,7 @@
 import pypy # __path__
 import py.path
-GI_VERSION = '1.1.0' # bump this for substantial changes
+GI_VERSION = '1.1.1'  # bump this for substantial changes
 # ____________________________________________________________
def eval_helper(self, typename, expr):
@@ -420,10 +420,12 @@
             self.initcode.append1('import sys')
             self.initcode.append1('import os')
             self.initcode.append1('libdir = os.path.join(pypy.__path__[0], 
"lib")\n'
-                                  'hold = sys.path[:]\n'
                                   'sys.path.insert(0, libdir)\n'
-                                  'import %s as _tmp\n'
-                                  'sys.path[:] = hold\n' % value.__name__)
+                                  'try:\n'
+                                  '    import %s as _tmp\n'
+                                  'finally:\n'
+                                  '    if libdir in sys.path:\n'
+                                  '        sys.path.remove(libdir)\n' % 
value.__name__)

What I'm doing at compiletime is to figure out whether lib is needed
or not, and I know by compiletime whether the import works, etc.
Then I generate init code that adheres to this.

Why do I need to check there, too? Just as a safety belt if
something breaks?

ciao - chris

--
Christian Tismer             :^)   <mailto:[EMAIL PROTECTED]>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
     whom do you want to sponsor today?   http://www.stackless.com/
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to