Skip to content

Commit 3f2139c

Browse files
committed
Using importlib to import module
1 parent 52bbbf6 commit 3f2139c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doxystub/doxystub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import annotations
33
import re
44
import inspect
5+
import importlib
56
import sys
67
import os
78
import shutil
@@ -102,8 +103,7 @@ def __init__(self, module_name: str, doxygen_directory: str):
102103

103104
def process(self):
104105
# Load the module to stub
105-
exec(f"import {self.module_name}")
106-
self.module = eval(f"{self.module_name}")
106+
self.module = importlib.import_module(self.module_name)
107107

108108
# Running & parsing Doxygen
109109
self.run_doxygen()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
maintainer_email="[email protected]",
77
description="Stubs generator based on Doxygen+Boost.Python",
88
url="https://github.com/rhoban/doxystub",
9-
version="0.1.2",
9+
version="0.1.3",
1010
long_description=open("README.md").read(),
1111
long_description_content_type='text/markdown',
1212
license="MIT",

0 commit comments

Comments
 (0)