[Python-checkins] cpython (merge 3.2 -> default): Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
charles-francois.natali
python-checkins at python.org
Wed Jul 27 19:41:29 CEST 2011
http://hg.python.org/cpython/rev/5f003d725619
changeset: 71535:5f003d725619
parent: 71532:8989aa5b357c
parent: 71534:2bc740a83010
user: Charles-François Natali <neologix at free.fr>
date: Wed Jul 27 19:42:05 2011 +0200
summary:
Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime.
files:
Lib/pydoc.py | 4 ++--
Misc/NEWS | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -218,8 +218,8 @@
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 = tokenize.open(filename)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -237,6 +237,8 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list