MCPcopy
hub / github.com/scrapy/scrapy / _run_command_profiled

Function _run_command_profiled

scrapy/cmdline.py:225–234  ·  view source on GitHub ↗
(
    cmd: ScrapyCommand, args: list[str], opts: argparse.Namespace
)

Source from the content-addressed store, hash-verified

223
224
225def _run_command_profiled(
226 cmd: ScrapyCommand, args: list[str], opts: argparse.Namespace
227) -> None:
228 if opts.profile:
229 sys.stderr.write(f"scrapy: writing cProfile stats to {opts.profile!r}\n")
230 loc = locals()
231 p = cProfile.Profile()
232 p.runctx("cmd.run(args, opts)", globals(), loc)
233 if opts.profile:
234 p.dump_stats(opts.profile)
235
236
237if __name__ == "__main__":

Callers 1

_run_commandFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected