Skip to content

Commit 26a5323

Browse files
xueying4402wjwwood
andauthored
[backport] cache lookup of importlib metadata in Node action (#365) (#406)
Signed-off-by: William Woodall <[email protected]> Co-authored-by: William Woodall <[email protected]>
1 parent 6863994 commit 26a5323

File tree

1 file changed

+7
-1
lines changed
  • launch_ros/launch_ros/actions

1 file changed

+7
-1
lines changed

launch_ros/launch_ros/actions/node.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,15 @@ def instantiate_extension(
559559
return extension_instance
560560

561561

562+
g_entry_points_impl = None
563+
564+
562565
def get_extensions(logger):
566+
global g_entry_points_impl
563567
group_name = 'launch_ros.node_action'
564-
entry_points_impl = importlib_metadata.entry_points()
568+
if g_entry_points_impl is None:
569+
g_entry_points_impl = importlib_metadata.entry_points()
570+
entry_points_impl = g_entry_points_impl
565571
if hasattr(entry_points_impl, 'select'):
566572
groups = entry_points_impl.select(group=group_name)
567573
else:

0 commit comments

Comments
 (0)