Fix for randomely ocurring bug
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 06 Dec 2008 14:46:19 +0000
changeset 684 896672e44e03
parent 683 de829096b814
child 685 a440ced9a75f
Fix for randomely ocurring bug The bug and it's fix are described by the first comment from Guido in http://code.google.com/p/googleappengine/issues/detail?id=772. Patch by: Guido van Rossum
app/main.py
--- a/app/main.py	Sat Dec 06 14:44:02 2008 +0000
+++ b/app/main.py	Sat Dec 06 14:46:19 2008 +0000
@@ -37,6 +37,8 @@
 
 sys.path.insert(0, os.path.abspath('django.zip'))
 
+ultimate_sys_path = None
+
 # Force Django to reload its settings.
 from django.conf import settings
 settings._target = None
@@ -61,6 +63,12 @@
 
 
 def main():
+  global ultimate_sys_path
+  if ultimate_sys_path is None:
+    ultimate_sys_path = list(sys.path)
+  else:
+    sys.path[:] = ultimate_sys_path
+
   # Create a Django application for WSGI.
   application = django.core.handlers.wsgi.WSGIHandler()