Skip to content

Commit

Permalink
Merge pull request #12619 from OdinTech3/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Oct 13, 2020
2 parents d090ccf + 9225195 commit 219dea4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions IPython/core/magics/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from IPython.utils.timing import clock, clock2
from warnings import warn
from logging import error
from pathlib import Path
from io import StringIO
from pathlib import Path

Expand Down Expand Up @@ -360,17 +361,22 @@ def _run_with_profiler(self, code, opts, namespace):
text_file = opts.T[0]
if dump_file:
prof.dump_stats(dump_file)
print('\n*** Profile stats marshalled to file',\
repr(dump_file)+'.',sys_exit)
print(
f"\n*** Profile stats marshalled to file {repr(dump_file)}.{sys_exit}"
)
if text_file:
Path(text_file).write_text(output)
print('\n*** Profile printout saved to text file',\
repr(text_file)+'.',sys_exit)
pfile = Path(text_file)
pfile.touch(exist_ok=True)
pfile.write_text(output)

print(
f"\n*** Profile printout saved to text file {repr(text_file)}.{sys_exit}"
)

if 'r' in opts:
return stats
else:
return None

return None

@line_magic
def pdb(self, parameter_s=''):
Expand Down

0 comments on commit 219dea4

Please sign in to comment.