Skip to content

Commit

Permalink
switch to slightly more generic isinstance
Browse files Browse the repository at this point in the history
Signed-off-by: Tully Foote <[email protected]>
  • Loading branch information
tfoote committed Apr 1, 2020
1 parent 589320e commit 77df874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rclpy/rclpy/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def on_shutdown(self, callback: Callable[[], None]):
if not self.ok():
callback()
else:
if type(callback) == MethodType:
if isinstance(callback, MethodType):
self._callbacks.append(weakref.WeakMethod(callback, self._remove_callback))
else:
self._callbacks.append(weakref.ref(callback, self._remove_callback))

0 comments on commit 77df874

Please sign in to comment.