-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-37444: Update differing exception between builtins and importlib #14869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-37444: Update differing exception between builtins and importlib #14869
Conversation
9592ccd
to
314b4a4
Compare
Misc/NEWS.d/next/Core and Builtins/2019-07-20-22-34-42.bpo-37444.UOd3Xs.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor documentation tweaks needed before this is ready to merge.
Misc/NEWS.d/next/Core and Builtins/2019-07-20-22-34-42.bpo-37444.UOd3Xs.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nsiregar! I went ahead and added some What's New entries directly, as it's possible there may be code out there that's calling this API directly and expecting ValueError.
Doc/library/importlib.rst
Outdated
@@ -1433,13 +1433,18 @@ an :term:`importer`. | |||
``importlib.util.resolve_name('sys', __package__)`` without doing a | |||
check to see if the **package** argument is needed. | |||
|
|||
:exc:`ValueError` is raised if **name** is a relative module name but | |||
:exc:`ImportError` is raised if **name** is a relative module name but | |||
package is a false value (e.g. ``None`` or the empty string). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package is a false value (e.g. ``None`` or the empty string). | |
**package** is a false value (e.g. ``None`` or the empty string). |
@nsiregar: Status check is done, and it's a failure ❌ . |
1 similar comment
@nsiregar: Status check is done, and it's a failure ❌ . |
thanks @brettcannon , looks like CI is failing during documentation build and |
@nsiregar: Status check is done, and it's a failure ❌ . |
4b2f580
to
b0c8536
Compare
@nsiregar: Status check is done, and it's a success ✅ . |
…ythonGH-14869) Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure. https://bugs.python.org/issue37444 Automerge-Triggered-By: @brettcannon
…ythonGH-14869) Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure. https://bugs.python.org/issue37444 Automerge-Triggered-By: @brettcannon
…ythonGH-14869) Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure. https://bugs.python.org/issue37444 Automerge-Triggered-By: @brettcannon
Imports now raise
TypeError
instead ofValueError
for relative import failures. This makes things consistent betweenbuiltins.__import__
andimportlib.__import__
as well as using a more natural import for the failure.https://bugs.python.org/issue37444
Automerge-Triggered-By: @brettcannon