mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-21 19:47:21 +03:00
Fix ResourceWarning
This commit is contained in:
parent
2105940286
commit
331675d413
@ -310,7 +310,8 @@ def save_type_stub(text: str, fpath: str) -> None:
|
||||
fpath += 'i'
|
||||
preamble = '# Update this file by running: ./test.py mypy\n\n'
|
||||
try:
|
||||
existing = open(fpath).read()
|
||||
with open(fpath) as fs:
|
||||
existing = fs.read()
|
||||
except FileNotFoundError:
|
||||
existing = ''
|
||||
current = preamble + text
|
||||
|
Loading…
Reference in New Issue
Block a user