mirror of
https://github.com/beetbox/beets.git
synced 2025-12-20 23:53:15 +01:00
Fix deprecated plistlib function
https://docs.python.org/3.7/library/plistlib.html#plistlib.readPlist
This commit is contained in:
parent
e4c03fd63f
commit
a6305c36e1
1 changed files with 6 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ import shutil
|
|||
import tempfile
|
||||
import plistlib
|
||||
|
||||
import six
|
||||
from six.moves.urllib.parse import urlparse, unquote
|
||||
from time import mktime
|
||||
|
||||
|
|
@ -84,7 +85,11 @@ class Itunes(MetaSource):
|
|||
self._log.debug(
|
||||
u'loading iTunes library from {0}'.format(library_path))
|
||||
with create_temporary_copy(library_path) as library_copy:
|
||||
raw_library = plistlib.readPlist(library_copy)
|
||||
if six.PY2:
|
||||
raw_library = plistlib.readPlist(library_copy)
|
||||
else:
|
||||
with open(library_copy, 'rb') as library_copy_f:
|
||||
raw_library = plistlib.load(library_copy_f)
|
||||
except IOError as e:
|
||||
raise ConfigValueError(u'invalid iTunes library: ' + e.strerror)
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Reference in a new issue