Don't overwrite builtin

This commit is contained in:
Markus Unterwaditzer 2014-05-15 16:26:51 +02:00
parent f33b667b24
commit d3752baf60

View file

@ -37,9 +37,9 @@ class safe_write(object):
self.write = f.write
return self
def __exit__(self, type, value, tb):
def __exit__(self, cls, value, tb):
self.f.close()
if type is None:
if cls is None:
os.rename(self.tmppath, self.fpath)
else:
os.remove(self.tmppath)