mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
make sure the builtin help function doesn't fail when sys.stdin is not a valid file (closes #11709)
Original patch by Amaury Forgeot d'Arc with a test by bdettmer.
This commit is contained in:
parent
96e0430dfb
commit
159824ea2a
3 changed files with 13 additions and 0 deletions
|
@ -446,6 +446,14 @@ class PydocDocTest(unittest.TestCase):
|
|||
result, doc_loc = get_pydoc_text(xml.etree)
|
||||
self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link")
|
||||
|
||||
def test_getpager_with_stdin_none(self):
|
||||
previous_stdin = sys.stdin
|
||||
try:
|
||||
sys.stdin = None
|
||||
pydoc.getpager() # Shouldn't fail.
|
||||
finally:
|
||||
sys.stdin = previous_stdin
|
||||
|
||||
def test_non_str_name(self):
|
||||
# issue14638
|
||||
# Treat illegal (non-str) name like no name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue