Skip to content

Commit

Permalink
Use passed-in info argument for TraitType.error() (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Oct 28, 2023
1 parent 952d6a7 commit 3a03835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions traitlets/traitlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,13 +848,13 @@ def error(self, obj, value, error=None, info=None):
e = "The '{}' trait of {} instance expected {}, not {}.".format(
self.name,
class_of(obj),
self.info(),
info or self.info(),
describe("the", value),
)
else:
e = "The '{}' trait expected {}, not {}.".format(
self.name,
self.info(),
info or self.info(),
describe("the", value),
)
raise TraitError(e)
Expand Down

0 comments on commit 3a03835

Please sign in to comment.