mirror of
https://github.com/corpnewt/gibMacOS.git
synced 2024-12-04 13:33:26 +01:00
Update plist.py, downloader.py from pymodules
This commit is contained in:
parent
17ccaf862e
commit
620061df63
@ -28,6 +28,10 @@ except AttributeError:
|
||||
# Helper Methods #
|
||||
### ###
|
||||
|
||||
def get_data(value):
|
||||
if sys.version_info < (3,0): return plistlib.Data(value)
|
||||
return value
|
||||
|
||||
def _check_py3():
|
||||
return sys.version_info >= (3, 0)
|
||||
|
||||
@ -134,8 +138,8 @@ def loads(value, fmt=None, use_builtin_types=None, dict_type=dict):
|
||||
try:
|
||||
return load(BytesIO(value),fmt=fmt,use_builtin_types=use_builtin_types,dict_type=dict_type)
|
||||
except:
|
||||
# Python 3.9 removed use_builtin_types
|
||||
return load(BytesIO(value),fmt=fmt,dict_type=dict_type)
|
||||
# Python 3.9 removed use_builtin_types
|
||||
return load(BytesIO(value),fmt=fmt,dict_type=dict_type)
|
||||
def dump(value, fp, fmt=FMT_XML, sort_keys=True, skipkeys=False):
|
||||
if _check_py3():
|
||||
plistlib.dump(value, fp, fmt=fmt, sort_keys=sort_keys, skipkeys=skipkeys)
|
||||
|
Loading…
Reference in New Issue
Block a user