Fix `get_class_in_module`
# What does this PR do?

The PR #21646 added a line `subprocess.run(["python", "-c", cmd])`. But in our daily CI (docker env.), `python` binary doesn't exist, only `python3` binary exists, and this causes `FileNotFoundError: [Errno 2] No such file or directory: 'python'`.

This PRs adds `try ... except...` to avoid this failure, but it's really ugly. See my comment in this PR changes.
_The documentation is not available anymore as the PR was closed or merged._