New submission from Ben Lewis <benjamin.r.le...@gmail.com>:

>>> from curses import ascii
>>> from . import ascii

The second line should raise an ImportError but instead succeeds (tested 
cpython 3.6.7, 3.7.0 and 3.7.3, and from interactive interpreter and scripts). 
Specifically, builtins.__import__ does not reproduce the behaviour of 
importlib._bootstrap.__import__; maybe ceval.c:import_from is neglecting to 
check that there are parent packages when attempting a relative import?

More details here: https://stackoverflow.com/a/56768129/5104777

----------
components: Interpreter Core
messages: 346593
nosy: Ben Lewis2
priority: normal
severity: normal
status: open
title: relative import_from without parent
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37409>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to