summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_extcall.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-03-08 06:41:01 (GMT)
committerGitHub <noreply@github.com>2017-03-08 06:41:01 (GMT)
commit93602e3af70d3b9f98ae2da654b16b3382b68d50 (patch)
tree632030f1074215e980a070e718be27d2096ffe88 /Lib/test/test_extcall.py
parentbef209d449afcdc391b108d197a95b15902197d9 (diff)
downloadcpython-93602e3af70d3b9f98ae2da654b16b3382b68d50.zip
cpython-93602e3af70d3b9f98ae2da654b16b3382b68d50.tar.gz
cpython-93602e3af70d3b9f98ae2da654b16b3382b68d50.tar.bz2
[3.5] bpo-29537: Tolerate legacy invalid bytecode (#169)
bpo-27286 fixed a problem where BUILD_MAP_UNPACK_WITH_CALL could be emitted with an incorrect oparg value, causing the eval loop to access the wrong stack entry when attempting to read the function name. The associated magic number change caused significant problems when attempting to upgrade to 3.5.3 for anyone that relies on pre-cached bytecode remaining valid across maintenance releases. This patch restores the ability to import legacy bytecode generated by 3.5.0, 3.5.1 or 3.5.2, and modifies the eval loop to avoid any harmful consequences from the potentially malformed legacy bytecode. Original import patch by Petr Viktorin, eval loop patch by Serhiy Storchaka, and tests and integration by Nick Coghlan.
Diffstat (limited to 'Lib/test/test_extcall.py')
-rw-r--r--Lib/test/test_extcall.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py
index 9cb0d38..94501de 100644
--- a/Lib/test/test_extcall.py
+++ b/Lib/test/test_extcall.py
@@ -52,15 +52,15 @@ Here we add keyword arguments
>>> f(1, 2, **{'a': -1, 'b': 5}, **{'a': 4, 'c': 6})
Traceback (most recent call last):
...
- TypeError: f() got multiple values for keyword argument 'a'
+ TypeError: function got multiple values for keyword argument 'a'
>>> f(1, 2, **{'a': -1, 'b': 5}, a=4, c=6)
Traceback (most recent call last):
...
- TypeError: f() got multiple values for keyword argument 'a'
+ TypeError: function got multiple values for keyword argument 'a'
>>> f(1, 2, a=3, **{'a': 4}, **{'a': 5})
Traceback (most recent call last):
...
- TypeError: f() got multiple values for keyword argument 'a'
+ TypeError: function got multiple values for keyword argument 'a'
>>> f(1, 2, 3, *[4, 5], **{'a':6, 'b':7})
(1, 2, 3, 4, 5) {'a': 6, 'b': 7}
>>> f(1, 2, 3, x=4, y=5, *(6, 7), **{'a':8, 'b': 9})