*** Objects/unicodeobject.c.orig Wed Feb 5 12:48:57 2003 --- Objects/unicodeobject.c Wed Feb 5 11:49:27 2003 *************** *** 3528,3533 **** --- 3528,3538 ---- if (maxcount < 0) maxcount = INT_MAX; + if (str1->length == 0) { + PyErr_SetString(PyExc_ValueError, "empty pattern string"); + return NULL; + } + if (str1->length == 1 && str2->length == 1) { int i;