Commit 725e6f9b authored by Georg Brandl's avatar Georg Brandl

Fix pydoc.synopsis() so that it doesn't error out with an unreadable

module.
parent c934fb1a
......@@ -188,7 +188,11 @@ def synopsis(filename, cache={}):
lastupdate, result = cache.get(filename, (0, None))
if lastupdate < mtime:
info = inspect.getmoduleinfo(filename)
file = open(filename)
try:
file = open(filename)
except IOError:
# module can't be opened, so skip it
return None
if info and 'b' in info[2]: # binary modules have to be imported
try: module = imp.load_module('__temp__', file, filename, info[1:])
except: return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment