Bug 1729481: Fix a bug in the python-version hacks r=jewilde

I was checking if the caller was 'log' but that wasn't correct
because we pass the result of the function to log, we don't call
it from log

Differential Revision: https://phabricator.services.mozilla.com/D124939
This commit is contained in:
Tom Ritter 2021-09-17 19:31:35 +00:00
parent 1fb918261c
commit 6fd44d8476
2 changed files with 5 additions and 2 deletions

View File

@ -255,10 +255,13 @@ def ast_get_source_segment(code, node):
):
return ast.original_get_source_segment(code, node)
if caller.function == "log":
if caller.function == "assignment_node_to_source_filename_list":
return ""
raise Exception("ast_get_source_segment is not available with this Python version.")
raise Exception(
"ast_get_source_segment is not available with this Python version. (ver=%s.%s, caller=%s)"
% (sys.version_info.major, sys.version_info.minor, caller.function)
)
# Overwrite it so we don't accidently use it