Message185179
| Author |
eric.araujo |
| Recipients |
Claudiu.Popa, Naddiseo, docs@python, eric.araujo |
| Date |
2013年03月25日.02:54:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1364180087.37.0.0216439452602.issue12920@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> It seems to work perfectly on command line though.
If the code is saved in a file, yes, but not in an interactive interpreter. This is not actually related to IDLE, but to the fact that inspect.getsource merely finds the __file__ attribute of the module object for its argument. If a module object has no file, the error message indicates that it’s a built-in module (like sys), but this fails to take into account the special __main__ module in an interactive interpreter.
It might be worth it to improve the error message, and in any case the documentation can be improved. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年03月25日 02:54:47 | eric.araujo | set | recipients:
+ eric.araujo, docs@python, Claudiu.Popa, Naddiseo |
| 2013年03月25日 02:54:47 | eric.araujo | set | messageid: <1364180087.37.0.0216439452602.issue12920@psf.upfronthosting.co.za> |
| 2013年03月25日 02:54:47 | eric.araujo | link | issue12920 messages |
| 2013年03月25日 02:54:47 | eric.araujo | create |
|