# HG changeset patch # User Sverre Rabbelier # Date 1228574779 0 # Node ID 896672e44e036d318ed7a2c632fe4fe0d9c894e2 # Parent de829096b8140015745ff84f9e2ebdc99d26ece0 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 diff -r de829096b814 -r 896672e44e03 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()