diff --git a/Lib/fontTools/misc/plistlib.py b/Lib/fontTools/misc/plistlib.py index 0e1bd7d10..a23b92e6f 100644 --- a/Lib/fontTools/misc/plistlib.py +++ b/Lib/fontTools/misc/plistlib.py @@ -16,21 +16,19 @@ from fontTools.misc.py23 import ( tobytes, ) -# On python3, by default we deserialize elements as bytes, whereas on -# python2 we deserialize elements as plistlib.Data objects, in order -# to distinguish them from the built-in str type (which is bytes on python2). -# Similarly, by default on python3 we serialize bytes as elements; -# however, on python2 we serialize bytes as elements (they must -# only contain ASCII characters in this case). -# You can pass use_builtin_types=[True|False] to load/dump etc. functions to -# enforce the same treatment of bytes across python 2 and 3. +# By default, we +# - deserialize elements as bytes and +# - serialize bytes as elements. +# Before, on Python 2, we +# - deserialized elements as plistlib.Data objects, in order to +# distinguish them from the built-in str type (which is bytes on python2) +# - deserialized bytes as elements (they must have only contained +# ASCII characters in this case) +# You can pass use_builtin_types=[True|False] to the load/dump etc. functions +# to enforce a specific treatment. # NOTE that unicode type always maps to element, and plistlib.Data # always maps to element, regardless of use_builtin_types. -PY3 = sys.version_info[0] > 2 -if PY3: - USE_BUILTIN_TYPES = True -else: - USE_BUILTIN_TYPES = False +USE_BUILTIN_TYPES = True XML_DECLARATION = b""""""