summaryrefslogtreecommitdiff
path: root/django/utils/xmlutils.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /django/utils/xmlutils.py
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
downloaddjango-9c19aff7c7561e3a82978a272ecdaad40dda5c00.tar.gz
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'django/utils/xmlutils.py')
-rw-r--r--django/utils/xmlutils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/utils/xmlutils.py b/django/utils/xmlutils.py
index e4607b9865..c3eb3ba6a3 100644
--- a/django/utils/xmlutils.py
+++ b/django/utils/xmlutils.py
@@ -21,10 +21,12 @@ class SimplerXMLGenerator(XMLGenerator):
self.endElement(name)
def characters(self, content):
- if content and re.search(r'[\x00-\x08\x0B-\x0C\x0E-\x1F]', content):
+ if content and re.search(r"[\x00-\x08\x0B-\x0C\x0E-\x1F]", content):
# Fail loudly when content has control chars (unsupported in XML 1.0)
# See https://www.w3.org/International/questions/qa-controls
- raise UnserializableContentError("Control characters are not supported in XML 1.0")
+ raise UnserializableContentError(
+ "Control characters are not supported in XML 1.0"
+ )
XMLGenerator.characters(self, content)
def startElement(self, name, attrs):