From f6d2bd0225558710bc7c09945d4513922c3d9bdf Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 1 Dec 2021 11:46:48 +0100 Subject: [PATCH] fix not sure why this does not work --- install/MarcMentat/apply_DAMASK_modifications.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install/MarcMentat/apply_DAMASK_modifications.py b/install/MarcMentat/apply_DAMASK_modifications.py index 3e22a2319..4922af70f 100755 --- a/install/MarcMentat/apply_DAMASK_modifications.py +++ b/install/MarcMentat/apply_DAMASK_modifications.py @@ -14,8 +14,10 @@ def copy_and_patch(patch,orig,editor): except shutil.SameFileError: pass damask.util.run(f'patch {orig.parent/patch.stem} {patch} -b') - with open(orig.parent/patch.stem) as f_in, open(orig.parent/patch.stem,'w') as f_out: - f_out.write(f_in.read().replace('%EDITOR%',editor)) + with open(orig.parent/patch.stem) as f_in: + content = f_in.read() + with open(orig.parent/patch.stem,'w') as f_out: + f_out.write(content.replace('%EDITOR%',editor)) parser = argparse.ArgumentParser(