From b8ec9c58090961847a0b2961e1b0aa92588449d8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Jun 2021 22:16:35 +0530 Subject: [PATCH] another resource warning --- setup/check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/check.py b/setup/check.py index 451ba4ee9e..075f152430 100644 --- a/setup/check.py +++ b/setup/check.py @@ -89,7 +89,8 @@ class Check(Command): self.wn_path = os.path.expanduser('~/work/srv/main/static') self.has_changelog_check = os.path.exists(self.wn_path) try: - cache = json.load(open(self.cache_file, 'rb')) + with open(self.cache_file, 'rb') as f: + cache = json.load(f) except EnvironmentError as err: if err.errno != errno.ENOENT: raise