summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-01 22:05:31 +0000
committerGeorg Brandl <georg@python.org>2010-08-01 22:05:31 +0000
commit03c1cff57626e806b6e761be43dfb4e7d901a2fa (patch)
tree1c5adb924b860e108f1fa5fa75219e6261b5bf4b /Lib/pydoc.py
parentc5356994edac98da01305f7664182c4a6ed57b9d (diff)
downloadcpython-git-03c1cff57626e806b6e761be43dfb4e7d901a2fa.tar.gz
Merged revisions 83392,83426 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83392 | georg.brandl | 2010-08-01 10:22:05 +0200 (So, 01 Aug 2010) | 1 line #8471: reset _SpoofOut.buf to an empty string when truncating; if Unicode had been output previously, it had been coerced to a Unicode string, potentially making subsequent prints behave differently or raise UnicodeErrors. ................ r83426 | georg.brandl | 2010-08-01 21:06:51 +0200 (So, 01 Aug 2010) | 27 lines Merged revisions 83370,83372-83374,83384 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83370 | georg.brandl | 2010-07-31 23:51:48 +0200 (Sa, 31 Jul 2010) | 5 lines #8198: the Helper class should not save the stdin and stdout objects at import time, rather by default use the current streams like the other APIs that output help. ........ r83372 | georg.brandl | 2010-08-01 00:05:54 +0200 (So, 01 Aug 2010) | 1 line #4007: remove *.a and *.so.X.Y files in "make clean". ........ r83373 | georg.brandl | 2010-08-01 00:11:11 +0200 (So, 01 Aug 2010) | 1 line #5147: revert accidental indentation of header constant for MozillaCookieJar. ........ r83374 | georg.brandl | 2010-08-01 00:32:52 +0200 (So, 01 Aug 2010) | 1 line #5146: handle UID THREAD command correctly. ........ r83384 | georg.brandl | 2010-08-01 08:32:55 +0200 (So, 01 Aug 2010) | 1 line Build properties using lambdas. This makes test_pyclbr pass again, because it does not think that input and output are methods anymore. ........ ................
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 4d6584b4fc..86a6aa02c1 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1705,9 +1705,12 @@ class Helper:
'CONTEXTMANAGERS': ('context-managers', 'with'),
}
- def __init__(self, input, output):
- self.input = input
- self.output = output
+ def __init__(self, input=None, output=None):
+ self._input = input
+ self._output = output
+
+ input = property(lambda self: self._input or sys.stdin)
+ output = property(lambda self: self._output or sys.stdout)
def __repr__(self):
if inspect.stack()[1][3] == '?':
@@ -1884,7 +1887,7 @@ Enter any module name to get more help. Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".
''')
-help = Helper(sys.stdin, sys.stdout)
+help = Helper()
class Scanner:
"""A generic tree iterator."""