[Zope-CVS] CVS: Products/Ape - __init__.py:1.4

Shane Hathaway shane@zope.com
Wed, 9 Apr 2003 23:16:12 -0400


Update of /cvs-repository/Products/Ape
In directory cvs.zope.org:/tmp/cvs-serv922

Modified Files:
	__init__.py 
Log Message:
The version of apelib in the product now overrides
whatever version might be installed in sys.path, unless something else imports
apelib first.


=== Products/Ape/__init__.py 1.3 => 1.4 ===
--- Products/Ape/__init__.py:1.3	Wed Apr  9 23:09:47 2003
+++ Products/Ape/__init__.py	Wed Apr  9 23:16:11 2003
@@ -19,14 +19,14 @@
 import os
 import sys
 
+# Import the copy of apelib from 'lib' by temporarily changing sys.path.
+old_path = sys.path[:]
+here = __path__[0]
+sys.path.insert(0, os.path.join(here, 'lib'))
 try:
     import apelib
-except ImportError:
-    # Import the copy of apelib from 'lib' by temporarily changing sys.path.
-    old_path = sys.path[:]
-    here = __path__[0]
-    sys.path.insert(0, os.path.join(here, 'lib'))
-    import apelib
+finally:
+    # Restore sys.path
     sys.path[:] = old_path
 
 from apelib.zope2.setup import patches, dbtab