summaryrefslogtreecommitdiff
path: root/src/lxml/serializer.pxi
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-11-05 00:48:17 +0100
committerStefan Behnel <stefan_ml@behnel.de>2017-11-05 00:48:17 +0100
commitf56ebd30986f39b15a1a73f3c8d5a033ceea32c1 (patch)
treee944da5fc76525d629c94a2b07bfcf47649b6137 /src/lxml/serializer.pxi
parent1685d2bcc40ca5ca797d46f33a83b54027c8e781 (diff)
downloadpython-lxml-f56ebd30986f39b15a1a73f3c8d5a033ceea32c1.tar.gz
Remove useless Py3 adaptation that Cython can handle internally.
Diffstat (limited to 'src/lxml/serializer.pxi')
-rw-r--r--src/lxml/serializer.pxi8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lxml/serializer.pxi b/src/lxml/serializer.pxi
index 2970a59b..604fbc27 100644
--- a/src/lxml/serializer.pxi
+++ b/src/lxml/serializer.pxi
@@ -52,7 +52,7 @@ cdef _textToString(xmlNode* c_node, encoding, bint with_tail):
try:
needs_conversion = 0
- if encoding is _unicode:
+ if encoding is unicode:
needs_conversion = 1
elif encoding is not None:
# Python prefers lower case encoding names
@@ -68,7 +68,7 @@ cdef _textToString(xmlNode* c_node, encoding, bint with_tail):
if needs_conversion:
text = python.PyUnicode_DecodeUTF8(
<const_char*>c_text, tree.xmlBufferLength(c_buffer), 'strict')
- if encoding is not _unicode:
+ if encoding is not unicode:
encoding = _utf8(encoding)
text = python.PyUnicode_AsEncodedString(
text, encoding, 'strict')
@@ -99,7 +99,7 @@ cdef _tostring(_Element element, encoding, doctype, method,
c_method = _findOutputMethod(method)
if c_method == OUTPUT_METHOD_TEXT:
return _textToString(element._c_node, encoding, with_tail)
- if encoding is None or encoding is _unicode:
+ if encoding is None or encoding is unicode:
c_enc = NULL
else:
encoding = _utf8(encoding)
@@ -137,7 +137,7 @@ cdef _tostring(_Element element, encoding, doctype, method,
_raiseSerialisationError(error_result)
try:
- if encoding is _unicode:
+ if encoding is unicode:
result = (<unsigned char*>tree.xmlBufContent(
c_result_buffer))[:tree.xmlBufUse(c_result_buffer)].decode('UTF-8')
else: