Skip to content

Commit 3a03835

Browse files
authored
Use passed-in info argument for TraitType.error() (#884)
1 parent 952d6a7 commit 3a03835

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

traitlets/traitlets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,13 +848,13 @@ def error(self, obj, value, error=None, info=None):
848848
e = "The '{}' trait of {} instance expected {}, not {}.".format(
849849
self.name,
850850
class_of(obj),
851-
self.info(),
851+
info or self.info(),
852852
describe("the", value),
853853
)
854854
else:
855855
e = "The '{}' trait expected {}, not {}.".format(
856856
self.name,
857-
self.info(),
857+
info or self.info(),
858858
describe("the", value),
859859
)
860860
raise TraitError(e)

0 commit comments

Comments
 (0)