else:
loader = importer.find_module(modname)
if hasattr(loader,'get_source'):
+ try:
+ source = loader.get_source(modname)
+ except UnicodeDecodeError:
+ if onerror:
+ onerror(modname)
+ continue
import io
- desc = source_synopsis(
- io.StringIO(loader.get_source(modname))
- ) or ''
+ desc = source_synopsis(io.StringIO(source)) or ''
if hasattr(loader,'get_filename'):
path = loader.get_filename(modname)
else:
path = None
else:
- module = loader.load_module(modname)
+ try:
+ module = loader.load_module(modname)
+ except ImportError:
+ if onerror:
+ onerror(modname)
+ continue
desc = (module.__doc__ or '').splitlines()[0]
path = getattr(module,'__file__',None)
name = modname + ' - ' + desc
if modname[-9:] == '.__init__':
modname = modname[:-9] + ' (package)'
print(modname, desc and '- ' + desc)
+ def onerror(modname):
+ pass
try: import warnings
except ImportError: pass
else: warnings.filterwarnings('ignore') # ignore problems during import
- ModuleScanner().run(callback, key)
+ ModuleScanner().run(callback, key, onerror=onerror)
# --------------------------------------------------- web browser interface
(editors: check NEWS.help for information about editing NEWS using ReST.)
+What's new in Python 3.0b2?
+===========================
+
+*Release date: XX-XXX-2008*
+
+Core and Builtins
+-----------------
+
+Library
+-------
+
+- Issue #3145: help("modules whatever") failed when trying to load the source
+ code of every single module of the standard library, including invalid files
+ used in the test suite.
+
What's new in Python 3.0b1?
===========================