Skip to content

Commit

Permalink
Use Python 3.8-compatible string suffix removal idiom
Browse files Browse the repository at this point in the history
  • Loading branch information
popescu-v committed Oct 29, 2024
1 parent 521217d commit fbbce19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/LearningTestTool/py/_kht_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def extract_tool_exe_name(tool_full_exe_name):
return tool_full_exe_name
for suffix in kht.TOOL_MPI_SUFFIXES:
if tool_full_exe_name.endswith(suffix):
return tool_full_exe_name.removesuffix(suffix)
# TODO: Replace with `return tool_full_exe_name.removesuffix(suffix)`
# as soon as Python 3.8 support is dropped
return tool_full_exe_name[:tool_full_exe_name.index(suffix)]


"""
Expand Down

0 comments on commit fbbce19

Please sign in to comment.