Fix deprecation of module "imp"
This MR fixes the deprecation of Python module imp
. According to https://stackoverflow.com/questions/32175693/python-importlibs-analogue-for-imp-new-module, you have to substitute module creation by types.ModuleType
.