Use context managers to open files

Inspired by d50a6ddc1b.
This commit is contained in:
Luflosi
2019-08-01 13:21:26 -05:00
parent 68f3b6fbeb
commit 5f855ce547
17 changed files with 161 additions and 139 deletions

View File

@@ -229,7 +229,8 @@ def script_launch():
def update_intaller_wrapper():
# To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" installer.sh
src = open(__file__, 'rb').read().decode('utf-8')
with open(__file__, 'rb') as f:
src = f.read().decode('utf-8')
wrapper = sys.argv[-1]
with open(wrapper, 'r+b') as f:
raw = f.read().decode('utf-8')