瀏覽代碼

Fix regression in C tokenizer (#125)

tags/v0.4.3
Ben Kurtovic 9 年之前
父節點
當前提交
23d97583bf
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      mwparserfromhell/parser/ctokenizer/definitions.c

+ 4
- 1
mwparserfromhell/parser/ctokenizer/definitions.c 查看文件

@@ -65,8 +65,11 @@ static PyObject* unicode_to_lcase_ascii(PyObject *input, const char **string)
return NULL;
bytes = PyUnicode_AsASCIIString(lower);
Py_DECREF(lower);
if (!bytes)
if (!bytes) {
if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_UnicodeEncodeError))
PyErr_Clear();
return NULL;
}
*string = PyBytes_AS_STRING(bytes);
return bytes;
}


Loading…
取消
儲存