diff options
author | Michael Foord <michael@voidspace.org.uk> | 2013-02-11 00:28:02 +0000 |
---|---|---|
committer | Michael Foord <michael@voidspace.org.uk> | 2013-02-11 00:28:02 +0000 |
commit | 8773269f2b1e3d70a103463c03ad50c6a686dc68 (patch) | |
tree | f4eca3e793308709c201068b10e7cbdaf499e144 /Lib/pydoc.py | |
parent | 72354394fe386a12cfa0a5f790dd078ce12281e3 (diff) | |
parent | df5eab69989d66cb12ffa1ff39c5c0d9c4792538 (diff) | |
download | cpython-8773269f2b1e3d70a103463c03ad50c6a686dc68.tar.gz |
Merge. Closes issue 17052.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index fa531e9051..81fcfd9f0c 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -223,7 +223,7 @@ def synopsis(filename, cache={}): if lastupdate is None or lastupdate < mtime: try: file = tokenize.open(filename) - except IOError: + except OSError: # module can't be opened, so skip it return None binary_suffixes = importlib.machinery.BYTECODE_SUFFIXES[:] @@ -1393,7 +1393,7 @@ def getpager(): return lambda text: pipepager(text, os.environ['PAGER']) if os.environ.get('TERM') in ('dumb', 'emacs'): return plainpager - if sys.platform == 'win32' or sys.platform.startswith('os2'): + if sys.platform == 'win32': return lambda text: tempfilepager(plain(text), 'more <') if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0: return lambda text: pipepager(text, 'less') @@ -1419,7 +1419,7 @@ def pipepager(text, cmd): try: pipe.write(text) pipe.close() - except IOError: + except OSError: pass # Ignore broken pipes caused by quitting the pager program. def tempfilepager(text, cmd): |