Skip to content

Commit

Permalink
cache lookup of importlib metadata in Node action (#365)
Browse files Browse the repository at this point in the history
* cache lookup of importlib metadata in Node action

Signed-off-by: William Woodall <[email protected]>

* style fixup

Signed-off-by: William Woodall <[email protected]>

---------

Signed-off-by: William Woodall <[email protected]>
  • Loading branch information
wjwwood authored Jun 16, 2023
1 parent 02b3836 commit 13d6e1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion launch_ros/launch_ros/actions/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,15 @@ def instantiate_extension(
return extension_instance


g_entry_points_impl = None


def get_extensions(logger):
global g_entry_points_impl
group_name = 'launch_ros.node_action'
entry_points_impl = importlib_metadata.entry_points()
if g_entry_points_impl is None:
g_entry_points_impl = importlib_metadata.entry_points()
entry_points_impl = g_entry_points_impl
if hasattr(entry_points_impl, 'select'):
groups = entry_points_impl.select(group=group_name)
else:
Expand Down

0 comments on commit 13d6e1e

Please sign in to comment.