Skip to content

Commit fc07e53

Browse files
committed
Fix regression after moving lock
1 parent fe137e6 commit fc07e53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

openhtf/plugs/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ def initialize_plugs(
271271
raise base_plugs.InvalidPlugError(
272272
'Plug type "{}" is not an instance of base_plugs.BasePlug'.format(
273273
plug_type))
274-
if plug_type.logger != _BASE_PLUGS_LOG:
275-
# They put a logger attribute on the class itself, overriding ours.
276-
raise base_plugs.InvalidPlugError(
277-
'Do not override "logger" in your plugs.', plug_type)
278274

279275
# The following method of swapping out loggers is not thread-safe, so it is wrapped in a lock.
280276
with plug_type.init_lock:
277+
if plug_type.logger != _BASE_PLUGS_LOG:
278+
# They put a logger attribute on the class itself, overriding ours.
279+
raise base_plugs.InvalidPlugError(
280+
'Do not override "logger" in your plugs.', plug_type)
281281
# Override the logger so that __init__'s logging goes into the record.
282282
plug_type.logger = plug_logger
283283
try:

0 commit comments

Comments
 (0)