1. Alex Willmer
  2. trac-ticketlinks

Commits

jonas  committed 9b7e466

Merging [802] into 0.7-stable.

  • Participants
  • Parent commits 05e5e2f
  • Branches 0.7-stable

Comments (0)

Files changed (1)

File trac/ModPythonHandler.py

View file
  • Ignore whitespace
             send_project_index(req, mpr, env_parent_dir)
             return None
         
-    env_cache_lock.acquire()
-    if not env_path in env_cache:
-        env_cache[env_path] = open_environment(env_path, mpr)
-    env = env_cache[env_path]
-    env_cache_lock.release()
+    try:
+        env = None
+        env_cache_lock.acquire()
+        if not env_path in env_cache:
+            env_cache[env_path] = open_environment(env_path, mpr)
+        env = env_cache[env_path]
+    finally:
+        env_cache_lock.release()
     return env
 
 def handler(req):
-    global projects, projects_lock
-
     mpr = ModPythonRequest(req)
     mpr.init_request()