diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 19:14:22 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 19:14:22 (GMT) |
commit | 737fb89dd15e4db6ef30d25963e774ae09cc49dc (patch) | |
tree | 422450a087195dbb9e33c7d73d96fd2f1a5f1fcd /Lib/importlib | |
parent | 4001e96179543cf056613e65dcedc63716c6bc21 (diff) | |
download | cpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.zip cpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.tar.gz cpython-737fb89dd15e4db6ef30d25963e774ae09cc49dc.tar.bz2 |
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 2 | ||||
-rw-r--r-- | Lib/importlib/test/import_/test_fromlist.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 90eb1a7..aa4032c 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -415,7 +415,7 @@ class SourceLoader(_LoaderBasics): source_mtime is not None): # If e.g. Jython ever implements imp.cache_from_source to have # their own cached file format, this block of code will most likely - # throw an exception. + # raise an exception. data = bytearray(imp.get_magic()) data.extend(marshal._w_long(source_mtime)) data.extend(marshal.dumps(code_object)) diff --git a/Lib/importlib/test/import_/test_fromlist.py b/Lib/importlib/test/import_/test_fromlist.py index b903e8e..7ecde03 100644 --- a/Lib/importlib/test/import_/test_fromlist.py +++ b/Lib/importlib/test/import_/test_fromlist.py @@ -39,7 +39,7 @@ class HandlingFromlist(unittest.TestCase): If a package is being imported, then what is listed in fromlist may be treated as a module to be imported [module]. But once again, even if - something in fromlist does not exist as a module, no error is thrown + something in fromlist does not exist as a module, no error is raised [no module]. And this extends to what is contained in __all__ when '*' is imported [using *]. And '*' does not need to be the only name in the fromlist [using * with others]. |