Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

#11709: help-method crashes if sys.stdin is None

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 10 months ago by kevin.palm
Modified:
5 years, 7 months ago
Reviewers:
berker.peksag
CC:
amaury.forgeotdarc, Benjamin Peterson, jesstess, palm.kevin, devnull_psf.upfronthosting.co.za, bdettmer, roxane
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 1

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/pydoc.py View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
Lib/test/test_pydoc.py View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 1
berkerpeksag
5 years, 7 months ago #1
http://bugs.python.org/review/11709/diff/12082/Lib/test/test_pydoc.py
File Lib/test/test_pydoc.py (right):

http://bugs.python.org/review/11709/diff/12082/Lib/test/test_pydoc.py#newcode424
Lib/test/test_pydoc.py:424: sys.stdin = previous_stdin
You could use try...finally here:

   previous_stdin = sys.stdin
   try:
       # test code
   finally:
       sys.stdin = previous_stdin

or you could use the test.support.swap_attr context manager.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+