Tools: close py file after checking for AP_FLAKE8_CLEAN

This commit is contained in:
Pierre Kancir 2023-08-22 23:23:09 +02:00 committed by Peter Barker
parent 904486c846
commit 1c1fa820b4

View File

@ -26,8 +26,8 @@ class AP_PreCommit(object):
@staticmethod @staticmethod
def has_flake8_tag(filepath): def has_flake8_tag(filepath):
content = open(filepath).read() with open(filepath) as fp:
return "AP_FLAKE8_CLEAN" in content return "AP_FLAKE8_CLEAN" in fp.read()
def files_are_flake8_clean(self, files_to_check): def files_are_flake8_clean(self, files_to_check):
if files_to_check: if files_to_check: