calibre/src/polyglot/plistlib.py
Kovid Goyal 9ff27782de
Remove useless __future__ imports
Not needed on python3
2020-08-22 18:47:55 +05:30

27 lines
550 B
Python

#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
from polyglot.builtins import is_py3
if is_py3:
from plistlib import loads, dumps # noqa
def unwrap_bytes(x):
return x
def wrap_bytes(x):
return x
else:
from plistlib import readPlistFromString as loads, writePlistToString as dumps, Data # noqa
def unwrap_bytes(x):
if isinstance(x, Data):
x = x.data
return x
def wrap_bytes(x):
return Data(x)