Nick Coghlan added the comment: I haven't looked into the details of how cProfile handles command line arguments, but potentially relevant is issue #19982, which proposes adding a "target" parameter that lets runpy run in the context of an existing module object, rather than always creating its own.
However, if this can be implemented without that, go ahead - it can always be refactored later. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21862> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com