def run_subcmd(module, args):
if module:
- return module.main(args)
+ if do_profile:
+ import cProfile
+ f = compile('module.main(args)', __file__, 'exec')
+ cProfile.runctx(f, globals(), locals())
+ else:
+ module.main(args)
+ return
c = (do_profile and [sys.executable, b'-m', b'cProfile'] or []) + args
if not (fix_stdout or fix_stderr):