summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 9bdc4c7..7e01352 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2997,7 +2997,10 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
PyObject* sprefix = NULL;
PyObject* suri = NULL;
- suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict");
+ if (uri)
+ suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict");
+ else
+ suri = PyUnicode_FromString("");
if (!suri)
return;