summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-27 17:36:40 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-07-27 17:36:40 (GMT)
commit0cf7e25c28d48cd41819bc60ced0c9daa785c67a (patch)
tree66d98c369dc4bd186700e3aa7be1b3f69b26c727
parentd8e3901478b0ddf0b2c6cb2094a3d74f0168e4bf (diff)
downloadcpython-0cf7e25c28d48cd41819bc60ced0c9daa785c67a.zip
cpython-0cf7e25c28d48cd41819bc60ced0c9daa785c67a.tar.gz
cpython-0cf7e25c28d48cd41819bc60ced0c9daa785c67a.tar.bz2
- Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
-rwxr-xr-xLib/pydoc.py4
-rw-r--r--Misc/NEWS2
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index f119404..6bf6eb3 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -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)
diff --git a/Misc/NEWS b/Misc/NEWS
index c587f6e..9a99595 100644
--- 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.