STINNER Victor added the comment:

Running "python test.py" and "python -m test" changes how the code is loaded. 
With "python test.py", test.py becomes the "__main__" module, whereas "python 
-m test" uses the "test" module.

At Python exit, the __main__ module and other modules are destroyed differently.

Anyway, this issue is another example of the issue #22428 and so I close it as 
duplicate.

----------
resolution:  -> duplicate
superseder:  -> asyncio: KeyboardInterrupt inside a coroutine causes 
AttributeError
versions: +Python 3.5

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

Reply via email to