|
|
@@ -28,10 +28,13 @@ def must_close(errorfile = sys.stderr, wrap_verify = False): |
|
|
|
|
|
|
|
@wrap_class_method |
|
|
|
def __del__(orig, self, *args, **kwargs): |
|
|
|
if "_must_close" in self.__dict__: |
|
|
|
fprintf(errorfile, "error: %s.close() wasn't called!\n", |
|
|
|
self.__class__.__name__) |
|
|
|
return orig(self, *args, **kwargs) |
|
|
|
try: |
|
|
|
if "_must_close" in self.__dict__: |
|
|
|
fprintf(errorfile, "error: %s.close() wasn't called!\n", |
|
|
|
self.__class__.__name__) |
|
|
|
return orig(self, *args, **kwargs) |
|
|
|
except: # pragma: no cover |
|
|
|
pass |
|
|
|
|
|
|
|
@wrap_class_method |
|
|
|
def close(orig, self, *args, **kwargs): |
|
|
|