Skip to content

Commit

Permalink
return the registered slot from register_slot
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang committed Mar 20, 2019
1 parent ae9f878 commit 20b8c8b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def register_slot(cls, name, default=None):
with cls._lock:
if name in cls._slots:
raise ValueError('slot {} already registered'.format(name))
cls._slots[name] = cls.Slot(name, default)
slot = cls.Slot(name, default)
cls._slots[name] = slot
return slot


class _AsyncRuntimeContext(_RuntimeContext):
Expand Down

0 comments on commit 20b8c8b

Please sign in to comment.