Skip to content

Commit ec5bd95

Browse files
committed
bypass(NIM-BUG): nimAllowNonVarDestructor not works for Lib/n_tempfile
1 parent 7a74346 commit ec5bd95

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pylib/Lib/n_tempfile.nim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ proc close*(self: TemporaryDirectoryWrapper) =
172172
try: self.cleanup()
173173
except Exception: discard
174174

175-
when NimMajor == 1:
176-
proc `=destroy`*(self: var TemporaryDirectoryWrapper) = self.close()
177-
else:
175+
when (NimMajor, NimMinor, NimPatch) >= (2, 1, 1):
176+
## XXX: FIXED-NIM-BUG: though nimAllowNonVarDestructor is defined at least since 2.0.6,
177+
## it still cannot be compiled till abour 2.1.1
178178
proc `=destroy`*(self: TemporaryDirectoryWrapper) = self.close()
179+
else:
180+
proc `=destroy`*(self: var TemporaryDirectoryWrapper) = self.close()

0 commit comments

Comments
 (0)