Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions openhtf/plugs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,6 @@ def initialize_plugs(
plug_instance: plug_type
if plug_type in self._unmanaged_plugs:
plug_instance = self._unmanaged_plugs[plug_type]
try:
plug_instance.setUp()
except Exception: # pylint: disable=broad-except
self.tear_down_plugs()
raise
else:
# Create a logger for this plug. All plug loggers go under the 'plug'
# sub-logger in the logger hierarchy.
Expand Down Expand Up @@ -304,7 +299,7 @@ def initialize_plugs(
plug_logger.exception('Exception instantiating plug type %s', plug_type)
self.tear_down_plugs()
raise
self.update_plug(plug_type, plug_instance)
self.update_plug(plug_type, plug_instance)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo i think the actual fix is to not call update_plug in add_non_managed_plug and tear_down_plugs for the unmanaged plugs, but this theoretically does the same thing. We might run into some edge case later on because the non-managed plugs are added to plugs_by_type and _by_name earlier than the managed plugs, but it's probably fine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to implement when I've got more time :)

try:
plug_instance.setUp()
except Exception: # pylint: disable=broad-except
Expand Down