mirror of https://xfnw.ttm.sh/git/oirc.git
replace __import__ with importlib to remove unnessisary eval
This commit is contained in:
parent
f247327678
commit
30cd6fb324
3
bot.py
3
bot.py
|
@ -63,8 +63,7 @@ class Server(BaseServer):
|
|||
async def load_modules(self):
|
||||
for i in [s for s in os.listdir('modules') if '.py' in s and '.swp' not in s]:
|
||||
i = i[:-3]
|
||||
m = __import__('modules.' + i)
|
||||
m = eval('m.' + i)
|
||||
m = importlib.import_module('modules.' + i)
|
||||
asyncio.create_task(m.init(self))
|
||||
modules[i] = m
|
||||
|
||||
|
|
Loading…
Reference in New Issue