#ifndef Py_LIMITED_API
/* Test whether a unicode is equal to ASCII identifier. Return 1 if true,
- 0 otherwise. Return 0 if any argument contains non-ASCII characters.
+ 0 otherwise. The right argument must be ASCII identifier.
Any error occurs inside will be cleared before return. */
PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId(
#ifndef Py_LIMITED_API
/* Test whether a unicode is equal to ASCII string. Return 1 if true,
- 0 otherwise. Return 0 if any argument contains non-ASCII characters.
+ 0 otherwise. The right argument must be ASCII-encoded string.
Any error occurs inside will be cleared before return. */
PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString(
{
size_t len;
assert(_PyUnicode_CHECK(unicode));
+ assert(str);
+#ifndef NDEBUG
+ for (const char *p = str; *p; p++) {
+ assert((unsigned char)*p < 128);
+ }
+#endif
if (PyUnicode_READY(unicode) == -1) {
/* Memory error or bad data */
PyErr_Clear();
assert(_PyUnicode_CHECK(left));
assert(right->string);
+#ifndef NDEBUG
+ for (const char *p = right->string; *p; p++) {
+ assert((unsigned char)*p < 128);
+ }
+#endif
if (PyUnicode_READY(left) == -1) {
/* memory error or bad data */