Closed amotl closed 2 years ago
Hi Andreas,
ModuleNotFoundError
is a subclass of ImportError
. You can catch either ImportError
or ModuleNotFoundError
, and I tend to just always catch ImportError
. I'm not sure that the README needs to be updated.
Hi Paul,
oh you are right. I don't know why this issue happened to me. I will close it and may come back to it when I will be able to re-evaluate the problems I've observed, if any.
With kind regards, Andreas.
As expected, everything works flawlessly when using ImportError
again with https://github.com/crate/crate-python/commit/4d655b6c2, tested on behalf of https://github.com/crate/crate-python/pull/466. I don't know what went wrong before, so again sorry for the noise.
Dear Paul,
thanks a stack for maintaining this package. I just used it for the very first time, and copied the snippet from the README as advertised, and how I expected it to work out of the box. Using a try/except on an
ImportError
is usually what we are all used to do since ages, right?Now I was baffled to find that in this case, Python 3.8 reports a
ModuleNotFoundError
. I think it probably always have been like that,ImportError
would only be raised infrom abc import foo
-style cases, where the top-level package module exists, but not a submodule.I just wanted to make sure you agree on this before I would submit a corresponding patch to the README.
With kind regards, Andreas.
Reproduction