summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hupp <adam@hupp.org>2012-09-17 11:06:00 -0700
committerAdam Hupp <adam@hupp.org>2012-09-17 11:06:00 -0700
commit91cd6d42ee173bbf117c0e395bcd7bd2084ecbaa (patch)
treef6aa7d71ebd2209bdabd0a107322f0c1b3a19650
parent6c23fa27c62c1b3dc0da842fb5e06c7d7aecbfe2 (diff)
parent4b88db6041301221eafc306f88a535ba62a53356 (diff)
downloadpython-magic-91cd6d42ee173bbf117c0e395bcd7bd2084ecbaa.tar.gz
Merge pull request #19 from edevil/master
Check if 'magic_close' still has a value on __del__()
-rw-r--r--magic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/magic.py b/magic.py
index a3e2bf1..42d51ce 100644
--- a/magic.py
+++ b/magic.py
@@ -69,7 +69,7 @@ class Magic:
return magic_file(self.cookie, filename)
def __del__(self):
- if self.cookie:
+ if self.cookie and magic_close:
magic_close(self.cookie)
self.cookie = None