[issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path

Amaury Forgeot d'Arc report at bugs.python.org
Fri Jan 23 16:44:48 CET 2015


Amaury Forgeot d'Arc added the comment:

This change will cause the module to be imported twice:
    progname = runpy.run_module(args[0])['__file__']
... and then the runctx() call.

What about something like:
    code = "runpy.run_module(modname, run_name='__main__')"
    globs = { 'runpy': runpy, 'modname': args[0] }

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21862>
_______________________________________


More information about the Python-bugs-list mailing list