aboutsummaryrefslogtreecommitdiff
path: root/lldb/bindings/python/createPythonInit.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/bindings/python/createPythonInit.py')
-rw-r--r--lldb/bindings/python/createPythonInit.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/bindings/python/createPythonInit.py b/lldb/bindings/python/createPythonInit.py
index 3deb9159b702..4ad7320675f4 100644
--- a/lldb/bindings/python/createPythonInit.py
+++ b/lldb/bindings/python/createPythonInit.py
@@ -10,6 +10,14 @@ importNames = ', '.join('"{}"'.format(getFileName(f)) for f in pkgFiles)
script = """__all__ = [{import_names}]
for x in __all__:
__import__('lldb.{pkg_name}.' + x)
+
+def __lldb_init_module(debugger, internal_dict):
+ import lldb
+ for x in __all__:
+ submodule = getattr(lldb.{pkg_name}, x)
+ lldb_init = getattr(submodule, '__lldb_init_module', None)
+ if lldb_init:
+ lldb_init(debugger, internal_dict)
""".format(import_names=importNames, pkg_name=pkgRelDir.replace("/", "."))
pkgIniFile = os.path.normpath(os.path.join(pkgRelDir, "__init__.py"))