Add missing path-error handler for hyperopt
This commit is contained in:
parent
1a10e12861
commit
43031aa3bb
@ -52,11 +52,14 @@ class HyperOptResolver(IResolver):
|
|||||||
abs_paths.insert(0, Path(extra_dir))
|
abs_paths.insert(0, Path(extra_dir))
|
||||||
|
|
||||||
for _path in abs_paths:
|
for _path in abs_paths:
|
||||||
|
try:
|
||||||
hyperopt = self._search_object(directory=_path, object_type=IHyperOpt,
|
hyperopt = self._search_object(directory=_path, object_type=IHyperOpt,
|
||||||
object_name=hyperopt_name)
|
object_name=hyperopt_name)
|
||||||
if hyperopt:
|
if hyperopt:
|
||||||
logger.info('Using resolved hyperopt %s from \'%s\'', hyperopt_name, _path)
|
logger.info('Using resolved hyperopt %s from \'%s\'', hyperopt_name, _path)
|
||||||
return hyperopt
|
return hyperopt
|
||||||
|
except FileNotFoundError:
|
||||||
|
logger.warning('Path "%s" does not exist', _path.relative_to(Path.cwd()))
|
||||||
|
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"Impossible to load Hyperopt '{}'. This class does not exist"
|
"Impossible to load Hyperopt '{}'. This class does not exist"
|
||||||
|
Loading…
Reference in New Issue
Block a user