You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by gr...@apache.org on 2006/03/28 08:18:10 UTC

svn commit: r389413 - in /httpd/mod_python/trunk: lib/python/mod_python/__init__.py lib/python/mod_python/importer.py src/include/mpversion.h

Author: grahamd
Date: Mon Mar 27 22:18:06 2006
New Revision: 389413

URL: http://svn.apache.org/viewcvs?rev=389413&view=rev
Log:
Can't avoid doing stat on file if module marked as dirty from previously
failed import as mtime will never be updated and it will reload on every
subsequent request. Code also wasn't distinguishing empty dictionary from
None properly, meaning that per request module cache wasn't being used,
resulting in potential loss of efficiency in certain cases and danger of
loading multiple instances of same module in context of one request if file
on disk change at that instance in time. (MODPYTHON-143)

Modified:
    httpd/mod_python/trunk/lib/python/mod_python/__init__.py
    httpd/mod_python/trunk/lib/python/mod_python/importer.py
    httpd/mod_python/trunk/src/include/mpversion.h

Modified: httpd/mod_python/trunk/lib/python/mod_python/__init__.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/__init__.py?rev=389413&r1=389412&r2=389413&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/__init__.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/__init__.py Mon Mar 27 22:18:06 2006
@@ -20,5 +20,5 @@
 __all__ = ["apache", "cgihandler", "psp",
            "publisher", "util", "python22"]
 
-version = "3.3.0-dev-20060326"
+version = "3.3.0-dev-20060328"
 

Modified: httpd/mod_python/trunk/lib/python/mod_python/importer.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/importer.py?rev=389413&r1=389412&r2=389413&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/importer.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/importer.py Mon Mar 27 22:18:06 2006
@@ -388,7 +388,7 @@
         # least record the fact that the module is a
         # child of the parent.
 
-        if modules:
+        if modules is not None:
             if modules.has_key(label):
                 if context:
                     context.children[label] = time.time()
@@ -522,7 +522,7 @@
                 # of a cyclical import, avoids a never ending
                 # recursive loop.
 
-                if modules:
+                if modules is not None:
                     modules[label] = module
 
                 # Perform actual import of the module.
@@ -602,7 +602,7 @@
                 # of a cyclical import, avoids a never ending
                 # recursive loop.
 
-                if modules:
+                if modules is not None:
                     modules[label] = module
 
                 # If this is a child import of some parent
@@ -652,11 +652,6 @@
             if self._frozen or not autoreload:
                 return (cache, False)
 
-            # Check if module has been marked as dirty.
-
-            if cache.mtime == 0:
-                return (cache, True)
-
             # Has modification time changed.
 
             try:
@@ -748,7 +743,7 @@
             # as can cause problems. Rely on the parent
             # being modified to cause a reload.
 
-            if modules:
+            if modules is not None:
                 modules[current.label] = current.module
 
             return False
@@ -794,7 +789,7 @@
 
         visited[current.label] = current
 
-        if modules:
+        if modules is not None:
             modules[current.label] = current.module
 
         return False

Modified: httpd/mod_python/trunk/src/include/mpversion.h
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/include/mpversion.h?rev=389413&r1=389412&r2=389413&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/include/mpversion.h (original)
+++ httpd/mod_python/trunk/src/include/mpversion.h Mon Mar 27 22:18:06 2006
@@ -1,5 +1,5 @@
 #define MPV_MAJOR 3
 #define MPV_MINOR 3
 #define MPV_PATCH 0
-#define MPV_BUILD 20060326
-#define MPV_STRING "3.3.0-dev-20060326"
+#define MPV_BUILD 20060328
+#define MPV_STRING "3.3.0-dev-20060328"