Permalink
Browse files

Fix sys.path issue using ultimate_sys_path approach.

  • Loading branch information...
1 parent 597dd5f commit 2397bb45b3df7e83c2bd377523072047b9143e49 @andialbrecht andialbrecht committed with Arachnid Oct 26, 2009
Showing with 13 additions and 1 deletion.
  1. +1 −0 admin.py
  2. +11 −1 fix_path.py
  3. +1 −0 static.py
View
@@ -18,6 +18,7 @@
def main():
+ fix_path.fix_sys_path()
run_wsgi_app(application)
View
@@ -1,4 +1,14 @@
import os
import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib'))
+
+# see issue772: http://code.google.com/p/googleappengine/issues/detail?id=772
+ultimate_sys_path = None
+
+def fix_sys_path():
+ global ultimate_sys_path
+ if ultimate_sys_path is None:
+ ultimate_sys_path = list(sys.path)
+ else:
+ sys.path[:] = ultimate_sys_path
View
@@ -128,6 +128,7 @@ def get(self, path):
def main():
+ fix_path.fix_sys_path()
run_wsgi_app(application)

0 comments on commit 2397bb4

Please sign in to comment.