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
$ python run.py
Traceback (most recent call last):
File "/Users/jasha10/hydra.git/hydra/_internal/instantiate/_instantiate2.py", line 62, in _call_target
return _target_(*args, **kwargs)
File "/Users/jasha10/hydra_tmp/1911/module.py", line 8, in foo
raise MyException()
module.MyException
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jasha10/hydra_tmp/1911/run.py", line 4, in <module>
instantiate({"_target_": "module.foo"})
File "/Users/jasha10/hydra.git/hydra/_internal/instantiate/_instantiate2.py", line 180, in instantiate
return instantiate_node(config, *args, recursive=_recursive_, convert=_convert_)
File "/Users/jasha10/hydra.git/hydra/_internal/instantiate/_instantiate2.py", line 249, in instantiate_node
return _call_target(_target_, *args, **kwargs)
File "/Users/jasha10/hydra.git/hydra/_internal/instantiate/_instantiate2.py", line 64, in _call_target
raise type(e)(
TypeError: __init__() takes 1 positional argument but 2 were given
馃悰 Bug
Description
When there's an instantiation exception, raising a chained exception sometimes also fails because it doesn't take an argument:
hydra/hydra/_internal/instantiate/_instantiate2.py
Lines 63 to 66 in 9759f87
Checklist
To reproduce
Try to instantiate an object such that it raises an exception that doesn't take any argument.
Expected Behavior
Maybe it should try to show another type of exception instead? Or chaining (
from e
).System information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: