Skip to content

Commit 4d9777c

Browse files
authored
Use .removesuffix of .rstrip when trying to import Python files. (#1099)
Fixes #1094 Signed-off-by: Caleb Brown <calebbrown@google.com>
1 parent 566dbc3 commit 4d9777c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sandboxes/dynamicanalysis/analyze-python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def path_to_import(path):
5858
if path.name == '__init__.py':
5959
import_path = str(path.parent)
6060
else:
61-
import_path = str(path).rstrip(PY_EXTENSION)
61+
import_path = str(path).removesuffix(PY_EXTENSION)
6262

6363
return import_path.replace('/', '.')
6464

0 commit comments

Comments
 (0)