##// END OF EJS Templates
Use pathlib in magics module's execution.py
Nick Muoh -
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
@@ -364,7 +365,10 b' class ExecutionMagics(Magics):'
364 f"\n*** Profile stats marshalled to file {repr(dump_file)}.{sys_exit}"
365 f"\n*** Profile stats marshalled to file {repr(dump_file)}.{sys_exit}"
365 )
366 )
366 if text_file:
367 if text_file:
367 Path(text_file).write_text(output)
368 pfile = Path(text_file)
369 pfile.touch(exist_ok=True)
370 pfile.write_text(output)
371
368 print(
372 print(
369 f"\n*** Profile printout saved to text file {repr(text_file)}.{sys_exit}"
373 f"\n*** Profile printout saved to text file {repr(text_file)}.{sys_exit}"
370 )
374 )
General Comments 0
You need to be logged in to leave comments. Login now