Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

No, I only used __main__.py to make it easy to reproduce the problem.
Pdb will not be able to access code in any module with a custom
__loader__.  For example, if you move f() to foo.py inside test.zip
and import it from __main__, you will see the same issue.  My patch
gives linecache.getlines() called by Pdb access to module's globs and
thus to its __loader__ .  It has nothing to do with runpy.

> The problem is actually with runpy not being able to set __file__
> correctly, rather than being pdb specific.

You must be thinking issue4197 where two distinct problems are
adressed:  first, the crash due to __file__ set to None by runpy and
second, missing globs parameter to linecache.getlines() in doctest
module.

My patch, doctest-1.patch works around the first issue and fixes the second.

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

Reply via email to