Skip to content

Commit

Permalink
Fix nit: don't split names twice
Browse files Browse the repository at this point in the history
  • Loading branch information
gshuflin committed Dec 3, 2019
1 parent b7c5fb5 commit 910a7ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/python/pants/subsystem/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ def get_streaming_workunit_callbacks(subsystem_names: Iterable[str]) -> List[Cal

for name in subsystem_names:
try:
module_name = '.'.join(name.split(".")[:-1])
class_name = name.split(".")[-1]
name_components = name.split(".")
module_name = ".".join(name_components[:-1])
class_name = name_components[-1]
module = importlib.import_module(module_name)
subsystem_class = getattr(module, class_name)
except (IndexError, AttributeError, ModuleNotFoundError, ValueError) as e:
Expand Down

0 comments on commit 910a7ec

Please sign in to comment.