From 715b0b576e26c81be18d375bea6f5507cb7427f4 Mon Sep 17 00:00:00 2001 From: Simon Beginn Date: Fri, 18 Mar 2022 23:50:38 +0100 Subject: [PATCH] Do not write if not needed --- server/setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/setup.py b/server/setup.py index b84f7f9..da2a5ac 100644 --- a/server/setup.py +++ b/server/setup.py @@ -55,9 +55,9 @@ def doTheReplace(fromApiStr, toApiStr, fromAuthStr, toAuthStr): newLines = newLines.replace(base64.b64encode(f'https://{fromApiStr}/subscription'.encode()).decode(), base64.b64encode(f'https://{toApiStr}/subscription'.encode()).decode()) if newLines != lines: numFiles += 1 - fh = open(os.path.join(p, ff), 'w') - fh.writelines(newLines) - fh.close() + fh = open(os.path.join(p, ff), 'w') + fh.writelines(newLines) + fh.close() except UnicodeDecodeError: # Brrr - binary files... pass