mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
Fixed open tmp file in python3
This commit is contained in:
@@ -65,7 +65,7 @@ def migrate_yml(in_fp, out_fp):
|
|||||||
def migrate(file_path, migration_fn):
|
def migrate(file_path, migration_fn):
|
||||||
# because we assume that original files can be reverted
|
# because we assume that original files can be reverted
|
||||||
# we will try to copy the content. (os.rename not needed)
|
# we will try to copy the content. (os.rename not needed)
|
||||||
with closing(tempfile.TemporaryFile()) as out_fp:
|
with closing(tempfile.TemporaryFile(mode='w+')) as out_fp:
|
||||||
with open(file_path, 'r') as in_fp:
|
with open(file_path, 'r') as in_fp:
|
||||||
migration_fn(in_fp, out_fp)
|
migration_fn(in_fp, out_fp)
|
||||||
with open(file_path, 'w') as in_fp:
|
with open(file_path, 'w') as in_fp:
|
||||||
|
|||||||
Reference in New Issue
Block a user