diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa497852c..7bb4cfecae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,10 +40,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed - - Fixed a bug where serve sanity checking would not be triggered using the latest PyTorchLightning version ([#493](https://github.com/PyTorchLightning/lightning-flash/pull/493)) + - Fixed a bug where train and validation metrics weren't being correctly computed ([#559](https://github.com/PyTorchLightning/lightning-flash/pull/559)) +- Fixed a bug where an uncaught ValueError could be raised when checking if a module is available ([#615](https://github.com/PyTorchLightning/lightning-flash/pull/615)) + ## [0.4.0] - 2021-06-22 ### Added diff --git a/flash/core/utilities/imports.py b/flash/core/utilities/imports.py index fc6c017bed..0364d695c7 100644 --- a/flash/core/utilities/imports.py +++ b/flash/core/utilities/imports.py @@ -43,6 +43,9 @@ def _module_available(module_path: str) -> bool: except ModuleNotFoundError: # Python 3.7+ return False + except ValueError: + # Sometimes __spec__ can be None and gives a ValueError + return True def _compare_version(package: str, op, version) -> bool: @@ -59,7 +62,7 @@ def _compare_version(package: str, op, version) -> bool: try: pkg_version = Version(pkg.__version__) except TypeError: - # this is mock by sphinx, so it shall return True ro generate all summaries + # this is mock by sphinx, so it shall return True to generate all summaries return True return op(pkg_version, Version(version))