Skip to content

Commit 3423b5b

Browse files
author
Ben Creech
committed
Fix __del__ bug if can't load dll
1 parent fca703b commit 3423b5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/py_mini_racer/py_mini_racer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ def _free(self, res):
360360
self._dll.mr_free_value(self.ctx, res)
361361

362362
def __del__(self):
363-
if self._dll:
363+
dll = getattr(self, "_dll", None)
364+
if dll:
364365
self._dll.mr_free_context(getattr(self, "ctx", None))
365366

366367

0 commit comments

Comments
 (0)