]> granicus.if.org Git - python/commitdiff
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
authorCharles-François Natali <neologix@free.fr>
Wed, 27 Jul 2011 17:36:40 +0000 (19:36 +0200)
committerCharles-François Natali <neologix@free.fr>
Wed, 27 Jul 2011 17:36:40 +0000 (19:36 +0200)
Lib/pydoc.py
Misc/NEWS

index f11940438ccd14da39fe84d415909fac567b9cdb..6bf6eb371bd67e150feccc6c8599f7eebfecb317 100755 (executable)
@@ -212,8 +212,8 @@ def source_synopsis(file):
 def synopsis(filename, cache={}):
     """Get the one-line summary out of a module file."""
     mtime = os.stat(filename).st_mtime
-    lastupdate, result = cache.get(filename, (0, None))
-    if lastupdate < mtime:
+    lastupdate, result = cache.get(filename, (None, None))
+    if lastupdate is None or lastupdate < mtime:
         info = inspect.getmoduleinfo(filename)
         try:
             file = open(filename)
index c587f6ec6d1fc1f5c8b1054af0ba688726af3661..9a99595d5829814f7016d5c5e12f8c248cf2638a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
+
 - Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
   given as a low fd, it gets overwritten.