Skip to content

Commit 1f475cb

Browse files
Remove except block only needed for Python 3.7
1 parent 7864496 commit 1f475cb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

astroid/interpreter/_import/util.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ def is_namespace(modname: str) -> bool:
7878

7979
# Repair last_submodule_search_locations
8080
if last_submodule_search_locations:
81-
# TODO: py38: remove except
82-
try:
83-
# pylint: disable=unsubscriptable-object
84-
last_item = last_submodule_search_locations[-1]
85-
except TypeError:
86-
last_item = last_submodule_search_locations._recalculate()[-1]
81+
# pylint: disable=unsubscriptable-object
82+
last_item = last_submodule_search_locations[-1]
8783
# e.g. for failure example above, add 'a/b' and keep going
8884
# so that find_spec('a.b.c', path=['a', 'a/b']) succeeds
8985
assumed_location = pathlib.Path(last_item) / component

0 commit comments

Comments
 (0)