Show More
@@ -39,6 +39,7 b' from IPython.utils.path import get_py_filename, shellglob' | |||||
39 | from IPython.utils.timing import clock, clock2 |
|
39 | from IPython.utils.timing import clock, clock2 | |
40 | from warnings import warn |
|
40 | from warnings import warn | |
41 | from logging import error |
|
41 | from logging import error | |
|
42 | from pathlib import Path | |||
42 | from io import StringIO |
|
43 | from io import StringIO | |
43 | from pathlib import Path |
|
44 | from pathlib import Path | |
44 |
|
45 | |||
@@ -360,17 +361,22 b' class ExecutionMagics(Magics):' | |||||
360 | text_file = opts.T[0] |
|
361 | text_file = opts.T[0] | |
361 | if dump_file: |
|
362 | if dump_file: | |
362 | prof.dump_stats(dump_file) |
|
363 | prof.dump_stats(dump_file) | |
363 | print('\n*** Profile stats marshalled to file',\ |
|
364 | print( | |
364 |
repr(dump_file) |
|
365 | f"\n*** Profile stats marshalled to file {repr(dump_file)}.{sys_exit}" | |
|
366 | ) | |||
365 | if text_file: |
|
367 | if text_file: | |
366 |
Path(text_file) |
|
368 | pfile = Path(text_file) | |
367 | print('\n*** Profile printout saved to text file',\ |
|
369 | pfile.touch(exist_ok=True) | |
368 | repr(text_file)+'.',sys_exit) |
|
370 | pfile.write_text(output) | |
|
371 | ||||
|
372 | print( | |||
|
373 | f"\n*** Profile printout saved to text file {repr(text_file)}.{sys_exit}" | |||
|
374 | ) | |||
369 |
|
375 | |||
370 | if 'r' in opts: |
|
376 | if 'r' in opts: | |
371 | return stats |
|
377 | return stats | |
372 | else: |
|
378 | ||
373 |
|
|
379 | return None | |
374 |
|
380 | |||
375 | @line_magic |
|
381 | @line_magic | |
376 | def pdb(self, parameter_s=''): |
|
382 | def pdb(self, parameter_s=''): |
General Comments 0
You need to be logged in to leave comments.
Login now