1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Update filesystem.py

fix WindowsError: [Error 32].
because must close the file before rename the file in window system.
This commit is contained in:
smallcode
2013-10-22 17:41:56 +08:00
parent deed8cab97
commit 16fbe40d87

View File

@@ -13,7 +13,7 @@ class FilesystemPersister(object):
fd, name = tempfile.mkstemp(dir=dirname, prefix=filename)
with os.fdopen(fd, 'w') as fout:
fout.write(contents)
os.rename(name, path)
os.rename(name, path)
@classmethod
def write(cls, cassette_path, data):