Use importlib.util.find_spec when checking if the given appModule exists to workaround issues in find_module and for forward compatibility. (#13853)
None, discussion in PR #13814
Summary of the issue:
As mentioned in #13814 (comment) FileFinder.find_module is deprecated. find_spec is the recommended replacement method.
As noted in #13814 (comment), using either find_spec or find_module with pkgutil.iter_importers results in paths containing "." being incorrectly treated as python packages, causing #13813
Description of development approach
Description of user facing changes
No user facing change
Description of development approach
When checking if the given appModule exists, instead use importlib.util.find_spec, which does not have the same problematic behaviour as pkgutil.iter_importers.