This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients Pinku Surana, xdegaye
Date 2016-11-05.16:51:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478364710.17.0.397025971918.issue28610@psf.upfronthosting.co.za>
In-reply-to
Content
This patch is an attempt at allowing the source debugging of scripts executed by the Python exec() function. It misses tests and documentation.

You may use it using the idiom given in the following example to avoid stepping into the pdb code on the first invocation of pdb.exec_script() (see the exec_script() doc string):

import sys

def main():
    foo = 123
    s = """if 1:
        x = foo
        x = 555
    """
    exec_script(s)

if __name__ == '__main__':
    if '--debug' in sys.argv[1:]:
        import pdb
        exec_script = pdb.exec_script
        pdb.Pdb(skip=['pdb']).set_trace()
    else:
        exec_script = exec

    main()
History
Date User Action Args
2016-11-05 16:51:50xdegayesetrecipients: + xdegaye, Pinku Surana
2016-11-05 16:51:50xdegayesetmessageid: <1478364710.17.0.397025971918.issue28610@psf.upfronthosting.co.za>
2016-11-05 16:51:50xdegayelinkissue28610 messages
2016-11-05 16:51:49xdegayecreate