Łukasz Langa <luk...@langa.pl> added the comment:

Why do you think OSError fits here? Since objects provided on the command line 
by definition cannot have source code files, the problem isn't that the file is 
missing or inaccessible. Rather, the value provided to getsource() is wrong. 
So, in my view, this should rather be ValueError.

Moreover, checking for __main__ is insufficient as there are __main__.py 
modules after all in many packages.

----------
nosy: +lukasz.langa

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

Reply via email to