##// END OF EJS Templates
Merge pull request #12665 from szarroug3/pathlib_io...
Matthias Bussonnier -
r26189:576a4113 merge
parent child Browse files
Show More
@@ -13,6 +13,7 b' import os'
13 import sys
13 import sys
14 import tempfile
14 import tempfile
15 import warnings
15 import warnings
16 from pathlib import Path
16 from warnings import warn
17 from warnings import warn
17
18
18 from IPython.utils.decorators import undoc
19 from IPython.utils.decorators import undoc
@@ -205,7 +206,7 b" def temp_pyfile(src, ext='.py'):"
205 It is the caller's responsibility to close the open file and unlink it.
206 It is the caller's responsibility to close the open file and unlink it.
206 """
207 """
207 fname = tempfile.mkstemp(ext)[1]
208 fname = tempfile.mkstemp(ext)[1]
208 with open(fname,'w') as f:
209 with open(Path(fname), "w") as f:
209 f.write(src)
210 f.write(src)
210 f.flush()
211 f.flush()
211 return fname
212 return fname
General Comments 0
You need to be logged in to leave comments. Login now