summaryrefslogtreecommitdiffstats
path: root/Lib/plistlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-07-23 15:49:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-07-23 15:49:31 (GMT)
commit8966759b031ce9977e038c5db1d8ed47c6c827a6 (patch)
treeea99d8ff1d15c264e4891df32ab6d707098ad201 /Lib/plistlib.py
parent64a12072801d0acb97bc259cf3db294771366d1c (diff)
downloadcpython-8966759b031ce9977e038c5db1d8ed47c6c827a6.zip
cpython-8966759b031ce9977e038c5db1d8ed47c6c827a6.tar.gz
cpython-8966759b031ce9977e038c5db1d8ed47c6c827a6.tar.bz2
Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
Diffstat (limited to 'Lib/plistlib.py')
-rw-r--r--Lib/plistlib.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index 8c148a8..b9946fd 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -984,18 +984,16 @@ def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
fp.seek(0)
for info in _FORMATS.values():
if info['detect'](header):
- p = info['parser'](
- use_builtin_types=use_builtin_types,
- dict_type=dict_type,
- )
+ P = info['parser']
break
else:
raise InvalidFileException()
else:
- p = _FORMATS[fmt]['parser'](use_builtin_types=use_builtin_types)
+ P = _FORMATS[fmt]['parser']
+ p = P(use_builtin_types=use_builtin_types, dict_type=dict_type)
return p.parse(fp)