You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose the user makes a syntax error in my_module.py, forgetting a colon in the class statement:
# my_module.pyclassFooprint("Hi")
python3 my_app.py
Traceback (most recent call last):
...
ValueError: Empty module name
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
...
File "/home/jasha10/hydra.git/hydra/_internal/utils.py", line 573, in _locate
raise ImportError(f"Error loading module '{path}'") from e
ImportError: Error loading module 'my_module.Foo'
The first part of this traceback, which says "ValueError: Empty module name", is not very helpful.
The traceback should instead look like this:
$ python3 my_app.py
Traceback (most recent call last):
...
class Foo
^
SyntaxError: invalid syntax
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
...
File "/home/jasha10/hydra.git/hydra/_internal/utils.py", line 573, in _locate
raise ImportError(f"Error loading module '{path}'") from e
ImportError: Error loading module 'my_module.Foo'
The text was updated successfully, but these errors were encountered:
The
hydra.utils.instantiate
function looks up it's target by using Python'simportlib
machinery.Suppose the user makes a syntax error in
my_module.py
, forgetting a colon in the class statement:The first part of this traceback, which says "
ValueError: Empty module name
", is not very helpful.The traceback should instead look like this:
The text was updated successfully, but these errors were encountered: