Beispiel #1
0
 def close(self):
     "Close any resources opened by libmagic"
     if self.cookie:
         api.magic_close(self.cookie)
         del self.weakref
     self.cookie = None
Beispiel #2
0
 def cleanup(_):
     warnings.warn("Implicitly cleaning up {0!r}".format(cookie),
             CleanupWarning)
     api.magic_close(cookie)
Beispiel #3
0
 def cleanup(_):
     warnings.warn("magic.Magic() not closed before being garbage "
             "collected. Magic.close() should be called when finished"
             "with",
             CleanupWarning)
     api.magic_close(cookie)
Beispiel #4
0
 def cleanup(_):
     warnings.warn("Implicitly cleaning up {0!r}".format(cookie),
                   CleanupWarning)
     api.magic_close(cookie)