mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-08 22:54:51 +00:00
Replace deprecated plistlib.readPlistFromBytes() in bookmarks.safari
Remove Python 2 code. plistlib.loads() was added in Python 3.4.
This commit is contained in:
parent
0ee4414a60
commit
2eb1424703
1 changed files with 1 additions and 4 deletions
|
|
@ -83,10 +83,7 @@ def get_plist_data_from_string (data):
|
|||
return biplist.readPlistFromString(data)
|
||||
# fall back to normal plistlist
|
||||
try:
|
||||
if hasattr(plistlib, 'readPlistFromBytes'): # Python 3
|
||||
return plistlib.readPlistFromBytes(data)
|
||||
else:
|
||||
return plistlib.readPlistFromString(data)
|
||||
return plistlib.loads(data)
|
||||
except Exception:
|
||||
# not parseable (eg. not well-formed, or binary)
|
||||
return {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue