We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5834b85 commit 7da112fCopy full SHA for 7da112f
src/commoncode/text.py
@@ -142,5 +142,6 @@ def as_unicode(s):
142
return ""
143
if not s:
144
return s
145
- assert isinstance(s, bytes), "s must be bytes but is: {}".format(s)
+ if not isinstance(s, bytes):
146
+ raise TypeError(f"s must be bytes, not {type(s).__name__}")
147
return UnicodeDammit(s).unicode_markup
0 commit comments