From b7975144623167702d54a2b96c11b5573dd3b91b Mon Sep 17 00:00:00 2001 From: Tejas Chauhan Date: Mon, 21 Apr 2025 02:57:00 +0530 Subject: [PATCH] Include invalid type in TypeError message --- six.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/six.py b/six.py index 3de5969b..4afefba3 100644 --- a/six.py +++ b/six.py @@ -785,13 +785,13 @@ def write(data): if isinstance(sep, unicode): want_unicode = True elif not isinstance(sep, str): - raise TypeError("sep must be None or a string") + raise TypeError("sep must be None or a string, not {0!r}".format(type(sep))) end = kwargs.pop("end", None) if end is not None: if isinstance(end, unicode): want_unicode = True elif not isinstance(end, str): - raise TypeError("end must be None or a string") + raise TypeError("end must be None or a string, not {0!r}".format(type(end))) if kwargs: raise TypeError("invalid keyword arguments to print()") if not want_unicode: