Do you think you could replace this code with expanding hiddenimports with filtered output from fuction hookutils.collect_submodules()?