diff options
Diffstat (limited to 'Modules/_elementtree.c')
-rw-r--r-- | Modules/_elementtree.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 46a1f41..b3b6976 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3038,7 +3038,10 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix, if (PyErr_Occurred()) return; - suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict"); + if (uri) + suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict"); + else + suri = PyUnicode_FromString(""); if (!suri) return; |