diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-04-20 20:25:55 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2013-04-20 20:25:55 (GMT) |
commit | f3bc94662800fd4c28f23375628f3447d2aa7b85 (patch) | |
tree | 152a2d77f6ab580cd204a69d3687128660dc4cc2 /Lib/pickle.py | |
parent | a6d67e6c5d8d635be58766712562bc4fe1eee9ba (diff) | |
parent | 1f7492c28a5aa5a1abfb3de9dc88ac440296a36c (diff) | |
download | cpython-f3bc94662800fd4c28f23375628f3447d2aa7b85.zip cpython-f3bc94662800fd4c28f23375628f3447d2aa7b85.tar.gz cpython-f3bc94662800fd4c28f23375628f3447d2aa7b85.tar.bz2 |
Merge 3.3
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r-- | Lib/pickle.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index d121ec9..b3b775f 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -1156,8 +1156,14 @@ class _Unpickler: def load_appends(self): stack = self.stack mark = self.marker() - list = stack[mark - 1] - list.extend(stack[mark + 1:]) + list_obj = stack[mark - 1] + items = stack[mark + 1:] + if isinstance(list_obj, list): + list_obj.extend(items) + else: + append = list_obj.append + for item in items: + append(item) del stack[mark:] dispatch[APPENDS[0]] = load_appends |