From 2f328e570c2cc509ca3cd44f4a10dbeb07b921fb Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Fri, 10 Mar 2023 20:38:30 +0000 Subject: [PATCH] Fix get_location_hash --- loki/lint/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loki/lint/utils.py b/loki/lint/utils.py index 82714b4cd..8ffdd98b6 100644 --- a/loki/lint/utils.py +++ b/loki/lint/utils.py @@ -156,7 +156,7 @@ def get_location_hash(location): The hash as a string or, if no hash can be created for :data:`location`, `None` is returned. """ - if getattr(location, 'source') and location.source.string: + if getattr(location, 'source', None) and location.source.string: first_line = location.source.string[:location.source.string.find('\n')] line_hash = str(md5(first_line.encode()).hexdigest()) return line_hash