Skip to content

Commit 91cd6d4

Browse files
committed
Merge pull request ahupp#19 from edevil/master
Check if 'magic_close' still has a value on __del__()
2 parents 6c23fa2 + 4b88db6 commit 91cd6d4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

magic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def from_file(self, filename):
6969
return magic_file(self.cookie, filename)
7070

7171
def __del__(self):
72-
if self.cookie:
72+
if self.cookie and magic_close:
7373
magic_close(self.cookie)
7474
self.cookie = None
7575

0 commit comments

Comments
 (0)