PyUnicode_CopyCharacters() uses exceptions instead of assertions
Call PyErr_BadInternalCall() if inputs are not unicode strings.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 065b5e7..a02c222 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -626,8 +626,10 @@
unsigned int from_kind, to_kind;
void *from_data, *to_data;
- assert(PyUnicode_Check(from));
- assert(PyUnicode_Check(to));
+ if (!PyUnicode_Check(from) || !PyUnicode_Check(to)) {
+ PyErr_BadInternalCall();
+ return -1;
+ }
if (PyUnicode_READY(from))
return -1;