What is the equivalent of imp.find_module in importlib

后端 未结 3 1609
闹比i
闹比i 2021-02-05 03:03

Some of my code use the now deprecated imp package to find a module

toolboxFile, toolboxPath, toolboxDescription = imp.find_module(\"Tools\")

3条回答
  •  不思量自难忘°
    2021-02-05 03:25

    I found this worked as a replacement for imp.find_module()

    importlib.machinery.PathFinder().find_spec(modName, modDirList)
    

提交回复
热议问题