summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom/expatbuilder.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/dom/expatbuilder.py')
-rw-r--r--Lib/xml/dom/expatbuilder.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py
index 81e2df7..8976144 100644
--- a/Lib/xml/dom/expatbuilder.py
+++ b/Lib/xml/dom/expatbuilder.py
@@ -121,10 +121,12 @@ def _parse_ns_name(builder, name):
qname = "%s:%s" % (prefix, localname)
qname = intern(qname, qname)
localname = intern(localname, localname)
- else:
+ elif len(parts) == 2:
uri, localname = parts
prefix = EMPTY_PREFIX
qname = localname = intern(localname, localname)
+ else:
+ raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name)
return intern(uri, uri), localname, prefix, qname