[issue33268] iteration over attrs in metaclass' __new__ affects class' __name__

2018-04-12 Thread tkhyn
tkhyn <thomas.khyn_pyt...@m4x.org> added the comment: oops, indeed. Sometimes the obvious things are not so obvious .. Sorry for the noise! -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33268] iteration over attrs in metaclass' __new__ affects class' __name__

2018-04-12 Thread tkhyn
New submission from tkhyn <thomas.khyn_pyt...@m4x.org>: The following script, run with python 3.6.5, highlights an issue with the class' __name__ attribute being set incorrectly just because of a loop in the metaclass' __new__ method: class MC(type): def __new__(mcs, name, bases,

[issue30436] importlib.find_spec raises AttributeError/ModuleNotFoundError when parent is not a package/module

2017-05-23 Thread tkhyn
tkhyn added the comment: Ok, thanks for the reply. Actually the thing that bothered me was the AttributeError exception. I would probably not have opened a ticket should find_spec have raised a ModuleNotFoundError (in line with import_module). Would you consider catching the AttributeError

[issue30436] importlib.find_spec raises AttributeError/ModuleNotFoundError when parent is not a package/module

2017-05-22 Thread tkhyn
New submission from tkhyn: Hello, I stumbled upon this issue when using the module_has_submodule function in Django, which raised an exception when trying to import a dotted path such as ``parent.module`` when ``parent`` does not exist or is not a package. I would expect (as well