From ce78200fb5d1698ae09e540783007a1397b6fcbd Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 3 Nov 2023 14:49:12 +0100 Subject: [PATCH] Pacify mypy Signed-off-by: Gilles Peskine --- tests/scripts/check_files.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/scripts/check_files.py b/tests/scripts/check_files.py index 3eb60d7242..a2a9dfa8d0 100755 --- a/tests/scripts/check_files.py +++ b/tests/scripts/check_files.py @@ -346,10 +346,13 @@ class MergeArtifactIssueTracker(LineIssueTracker): return False -THIS_FILE_BASE_NAME = \ - os.path.basename(inspect.getframeinfo(inspect.currentframe()).filename) -LINE_NUMBER_BEFORE_LICENSE_ISSUE_TRACKER = \ - inspect.getframeinfo(inspect.currentframe()).lineno +def this_location(): + frame = inspect.currentframe() + assert frame is not None + info = inspect.getframeinfo(frame) + return os.path.basename(info.filename), info.lineno +THIS_FILE_BASE_NAME, LINE_NUMBER_BEFORE_LICENSE_ISSUE_TRACKER = this_location() + class LicenseIssueTracker(LineIssueTracker): """Check copyright statements and license indications.