Skip to content

Commit a99eb0e

Browse files
committed
fix(py): with TemporaryDirectory(..) as n gave n not as str
1 parent 899052c commit a99eb0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pylib/Lib/n_tempfile.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ proc close*(self: TemporaryDirectoryWrapper) =
297297
try: self.cleanup()
298298
except Exception: discard
299299

300+
proc enter*(t: TemporaryDirectoryWrapper): PyStr = str t.name
301+
proc exit*(t: TemporaryDirectoryWrapper) = t.close()
302+
300303
template sinceNim(ma, mi, pa): bool =
301304
(NimMajor, NimMinor, NimPatch) >= (ma, mi, pa)
302305
const Js = defined(js)

0 commit comments

Comments
 (0)