bt2: py_plugin.py: cache `_PluginInfo` objects
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 19:46:05 +0000 (15:46 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 12 Aug 2019 21:13:59 +0000 (17:13 -0400)
This patch makes _try_load_plugin_module() cache the `_PluginInfo`
objects it creates. The cache, `_plugin_infos`, maps a Python plugin
absolute path to a `_PluginInfo` object.

This avoids loading the Python module twice, which can create problems,
for example destroying component classes earlier than expected when the
new module replaces the old one in `sys.modules`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I55397a1d5e65de1f6495dccc23e1134bd1127631
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1887
Tested-by: jenkins <jenkins@lttng.org>

No differences found
This page took 0.02474 seconds and 4 git commands to generate.