Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1306)

#25791: Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 9 months ago by brett
Modified:
1 year, 9 months ago
Reviewers:
rose
CC:
brett.cannon, Nick Coghlan, AntoinePitrou, scoder, devnull_psf.upfronthosting.co.za, eric.snow, superluser
Visibility:
Public.

Patch Set 1 #

Total comments: 4

Patch Set 2 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/importlib/_bootstrap.py View 1 1 chunk +6 lines, -0 lines 0 comments Download
Lib/test/test_importlib/import_/test___package__.py View 1 2 chunks +26 lines, -14 lines 0 comments Download
Python/import.c View 1 2 chunks +42 lines, -22 lines 2 comments Download
Python/importlib.h View 1 1 chunk +209 lines, -197 lines 0 comments Download

Messages

Total messages: 6
brett.cannon
http://bugs.python.org/review/25791/diff/16349/Lib/importlib/_bootstrap.py File Lib/importlib/_bootstrap.py (right): http://bugs.python.org/review/25791/diff/16349/Lib/importlib/_bootstrap.py#newcode1036 Lib/importlib/_bootstrap.py:1036: if spec and hasattr(spec, 'parent'): Two things. One, explicitly ...
1 year, 9 months ago #1
superluser
http://bugs.python.org/review/25791/diff/16350/Python/import.c File Python/import.c (right): http://bugs.python.org/review/25791/diff/16350/Python/import.c#newcode1451 Python/import.c:1451: PyErr_SetString(PyExc_TypeError, "__name__ must be a string"); not related to ...
1 year, 9 months ago #2
brett.cannon
http://bugs.python.org/review/25791/diff/16350/Python/import.c File Python/import.c (right): http://bugs.python.org/review/25791/diff/16350/Python/import.c#newcode1451 Python/import.c:1451: PyErr_SetString(PyExc_TypeError, "__name__ must be a string"); On 2016/01/14 00:11:17, ...
1 year, 9 months ago #3
brett.cannon
LGTM. Did you happen to test the stacklevel of the warning to make sure it ...
1 year, 9 months ago #4
superluser
On 2016/01/14 01:20:25, brett.cannon wrote: > LGTM. > > Did you happen to test the ...
1 year, 9 months ago #5
superluser
1 year, 9 months ago #6
also, should I add the missing goto?
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7