Fix warning in mustclose decorator

This commit is contained in:
Jim Paris 2013-02-18 17:56:59 -05:00
parent e241c13bf1
commit 52e674a192

View File

@ -38,7 +38,8 @@ def must_close(errorfile = sys.stderr, wrap_verify = False):
@wrap_class_method
def close(orig, self, *args, **kwargs):
del self._must_close
if "_must_close" in self.__dict__:
del self._must_close
return orig(self, *args, **kwargs)
# Optionally wrap all other functions