Torsten Landschoff added the comment:

Wow, this was news to me and I just ran into it in python 2.7. Checked in 
Python 3 and it's still there:

```
(py3)->torsten.landschoff@horatio:~$ python3 --version
Python 3.6.0a3+
(py3)->torsten.landschoff@horatio:~$ python3 -W error::sqlalchemy.exc.SAWarning 
-c "print()"
Invalid -W option ignored: invalid module name: 'sqlalchemy.exc'

```

I see no easy way to fix this. One way I thought about is to have hooks for 
importing of modules (called when a module is put into ``sys.modules``, not 
sure if there is something like this already) and have the warning system 
trigger on that.

There is no way to raise an exception before it is imported anyway...

----------
nosy: +torsten

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

Reply via email to