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
I would like to suggest a small fix in the way that Python 3's exception chaining is used.
As described in this article, exception chaining can be used to make exceptions more user-friendly, and in that case, the syntax raise new_exception from old_exception needs to be used.
For example,
try:
something_which_raises_TypeErrorexceptTypeErrorase:
raiseValueError("a more user-friendly exception message.") frome
the above should be used instead of
try:
something_which_raises_TypeErrorexceptTypeError:
raiseValueError("a more user-friendly exception message.")
The following files (or possibly more) can be modified according to this syntax:
Summary:
## Motivation
See #1943.
## Description of the changes
Fixed exception chaining with the syntax `raise new_exception from old_exception` as in #1943.
Pull Request resolved: #1945
Reviewed By: alexander-kirillov
Differential Revision: D23286925
Pulled By: ppwwyyxx
fbshipit-source-id: ff3f8a23f16f1cb49f10dcb3f2089ec3f9e26ee0
I would like to suggest a small fix in the way that Python 3's exception chaining is used.
As described in this article, exception chaining can be used to make exceptions more user-friendly, and in that case, the syntax
raise new_exception from old_exception
needs to be used.For example,
the above should be used instead of
The following files (or possibly more) can be modified according to this syntax:
detectron2/detectron2/data/catalog.py
Line 52 in f3ada7d
detectron2/detectron2/config/config.py
Line 141 in 439134d
detectron2/detectron2/data/transforms/augmentation.py
Line 88 in f3ada7d
detectron2/detectron2/engine/hooks.py
Line 334 in 439134d
Let me know your thoughts on this!
The text was updated successfully, but these errors were encountered: