diff --git a/Modules/getpath.c b/Modules/getpath.c index e2478da021f511..1e75993480ae36 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -690,7 +690,7 @@ env_to_dict(PyObject *dict, const char *key, int and_clear) // Quick convert to wchar_t, since we know key is ASCII wchar_t *wp = wkey; for (const char *p = &key[4]; *p; ++p) { - assert(*p < 128); + assert(!(*p & 0x80)); *wp++ = *p; } *wp = L'\0';