def close(self): "Close any resources opened by libmagic" if self.cookie: api.magic_close(self.cookie) del self.weakref self.cookie = None
def cleanup(_): warnings.warn("Implicitly cleaning up {0!r}".format(cookie), CleanupWarning) api.magic_close(cookie)
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)
def cleanup(_): warnings.warn("Implicitly cleaning up {0!r}".format(cookie), CleanupWarning) api.magic_close(cookie)