[pypy-svn] r15092 - in pypy/dist/pypy: annotation/test bin documentation/revreport interpreter interpreter/test module/__builtin__/test module/marshal/test module/sys/test objspace/flow/test objspace/std objspace/std/test objspace/test tool tool/pytest tool/test translator translator/c translator/c/test translator/goal translator/java translator/java/test translator/llvm2/tool translator/pyrex translator/pyrex/test translator/test translator/tool translator/tool/pygame

arigo at codespeak.net arigo at codespeak.net
Tue Jul 26 11:33:29 CEST 2005


Author: arigo
Date: Tue Jul 26 11:33:23 2005
New Revision: 15092

Modified:
   pypy/dist/pypy/annotation/test/autopath.py
   pypy/dist/pypy/bin/autopath.py
   pypy/dist/pypy/documentation/revreport/autopath.py
   pypy/dist/pypy/interpreter/autopath.py
   pypy/dist/pypy/interpreter/test/autopath.py
   pypy/dist/pypy/module/__builtin__/test/autopath.py
   pypy/dist/pypy/module/marshal/test/autopath.py
   pypy/dist/pypy/module/sys/test/autopath.py
   pypy/dist/pypy/objspace/flow/test/autopath.py
   pypy/dist/pypy/objspace/std/autopath.py
   pypy/dist/pypy/objspace/std/test/autopath.py
   pypy/dist/pypy/objspace/test/autopath.py
   pypy/dist/pypy/tool/autopath.py
   pypy/dist/pypy/tool/pytest/autopath.py
   pypy/dist/pypy/tool/test/autopath.py
   pypy/dist/pypy/translator/autopath.py
   pypy/dist/pypy/translator/c/autopath.py
   pypy/dist/pypy/translator/c/test/autopath.py
   pypy/dist/pypy/translator/goal/autopath.py
   pypy/dist/pypy/translator/java/autopath.py
   pypy/dist/pypy/translator/java/test/autopath.py
   pypy/dist/pypy/translator/llvm2/tool/autopath.py
   pypy/dist/pypy/translator/pyrex/autopath.py
   pypy/dist/pypy/translator/pyrex/test/autopath.py
   pypy/dist/pypy/translator/test/autopath.py
   pypy/dist/pypy/translator/tool/autopath.py
   pypy/dist/pypy/translator/tool/pygame/autopath.py
Log:
Yet Another Autopath Fix (tm).


Modified: pypy/dist/pypy/annotation/test/autopath.py
==============================================================================
--- pypy/dist/pypy/annotation/test/autopath.py	(original)
+++ pypy/dist/pypy/annotation/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/bin/autopath.py
==============================================================================
--- pypy/dist/pypy/bin/autopath.py	(original)
+++ pypy/dist/pypy/bin/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/documentation/revreport/autopath.py
==============================================================================
--- pypy/dist/pypy/documentation/revreport/autopath.py	(original)
+++ pypy/dist/pypy/documentation/revreport/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/interpreter/autopath.py
==============================================================================
--- pypy/dist/pypy/interpreter/autopath.py	(original)
+++ pypy/dist/pypy/interpreter/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/interpreter/test/autopath.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/autopath.py	(original)
+++ pypy/dist/pypy/interpreter/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/module/__builtin__/test/autopath.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/autopath.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/module/marshal/test/autopath.py
==============================================================================
--- pypy/dist/pypy/module/marshal/test/autopath.py	(original)
+++ pypy/dist/pypy/module/marshal/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/module/sys/test/autopath.py
==============================================================================
--- pypy/dist/pypy/module/sys/test/autopath.py	(original)
+++ pypy/dist/pypy/module/sys/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/objspace/flow/test/autopath.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/test/autopath.py	(original)
+++ pypy/dist/pypy/objspace/flow/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/objspace/std/autopath.py
==============================================================================
--- pypy/dist/pypy/objspace/std/autopath.py	(original)
+++ pypy/dist/pypy/objspace/std/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/objspace/std/test/autopath.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/autopath.py	(original)
+++ pypy/dist/pypy/objspace/std/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/objspace/test/autopath.py
==============================================================================
--- pypy/dist/pypy/objspace/test/autopath.py	(original)
+++ pypy/dist/pypy/objspace/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/tool/autopath.py
==============================================================================
--- pypy/dist/pypy/tool/autopath.py	(original)
+++ pypy/dist/pypy/tool/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/tool/pytest/autopath.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/autopath.py	(original)
+++ pypy/dist/pypy/tool/pytest/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/tool/test/autopath.py
==============================================================================
--- pypy/dist/pypy/tool/test/autopath.py	(original)
+++ pypy/dist/pypy/tool/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/autopath.py	(original)
+++ pypy/dist/pypy/translator/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/c/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/c/autopath.py	(original)
+++ pypy/dist/pypy/translator/c/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/c/test/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/c/test/autopath.py	(original)
+++ pypy/dist/pypy/translator/c/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/goal/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/goal/autopath.py	(original)
+++ pypy/dist/pypy/translator/goal/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/java/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/java/autopath.py	(original)
+++ pypy/dist/pypy/translator/java/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/java/test/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/java/test/autopath.py	(original)
+++ pypy/dist/pypy/translator/java/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/llvm2/tool/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/tool/autopath.py	(original)
+++ pypy/dist/pypy/translator/llvm2/tool/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/pyrex/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/pyrex/autopath.py	(original)
+++ pypy/dist/pypy/translator/pyrex/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/pyrex/test/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/pyrex/test/autopath.py	(original)
+++ pypy/dist/pypy/translator/pyrex/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/test/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/test/autopath.py	(original)
+++ pypy/dist/pypy/translator/test/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/tool/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/tool/autopath.py	(original)
+++ pypy/dist/pypy/translator/tool/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():

Modified: pypy/dist/pypy/translator/tool/pygame/autopath.py
==============================================================================
--- pypy/dist/pypy/translator/tool/pygame/autopath.py	(original)
+++ pypy/dist/pypy/translator/tool/pygame/autopath.py	Tue Jul 26 11:33:23 2005
@@ -50,8 +50,11 @@
         if fullorig.startswith(pypy_root):
             if os.path.exists(os.path.join(fullorig, '__init__.py')):
                 sys.path.remove(orig)
-    if head not in sys.path:
-        sys.path.insert(0, head)
+    try:
+        sys.path.remove(head)
+    except ValueError:
+        pass
+    sys.path.insert(0, head)
 
     munged = {}
     for name, mod in sys.modules.items():



More information about the Pypy-commit mailing list