Show More
@@ -13,6 +13,7 b' import os' | |||
|
13 | 13 | import sys |
|
14 | 14 | import tempfile |
|
15 | 15 | import warnings |
|
16 | from pathlib import Path | |
|
16 | 17 | from warnings import warn |
|
17 | 18 | |
|
18 | 19 | from IPython.utils.decorators import undoc |
@@ -205,7 +206,7 b" def temp_pyfile(src, ext='.py'):" | |||
|
205 | 206 | It is the caller's responsibility to close the open file and unlink it. |
|
206 | 207 | """ |
|
207 | 208 | fname = tempfile.mkstemp(ext)[1] |
|
208 |
with open(fname, |
|
|
209 | with open(Path(fname), "w") as f: | |
|
209 | 210 | f.write(src) |
|
210 | 211 | f.flush() |
|
211 | 212 | return fname |
General Comments 0
You need to be logged in to leave comments.
Login now