Sebastian <[email protected]> added the comment:

Oh, damn. I really forgot the argv filename thing. Nevermind :)

But back to topic. __file__ might be not the best solution for that. What does 
Python when embedded, and __file__ is not set? That can happen when the source 
of your code is not a file (multiline textbox, ...)

I would simply follow the way how the traceback solves this. Just print out the 
filename passed to:

Py_CompileStringFlags(const char *str, const char *filename, int start, 
PyCompilerFlags *flags)
PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, 
PyCompilerFlags *flags)
[...]

----------

_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8787>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to