diff --git a/iati/core/data.py b/iati/core/data.py index e8077b10..f7f644a9 100644 --- a/iati/core/data.py +++ b/iati/core/data.py @@ -81,7 +81,7 @@ def xml_str(self, value): # Convert the input to bytes, as etree.fromstring works most consistently with bytes objects, especially if an XML encoding declaration has been used. if (isinstance(value_stripped, str) - and sys.version_info.major > 2): # Python v2 treats strings as byte objects by default + and sys.version_info.major > 2): # Python v2 treats strings as byte objects by default value_stripped_bytes = value_stripped.encode() else: value_stripped_bytes = value_stripped