summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-02-01 20:53:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-02-01 20:53:03 (GMT)
commit3b23004112aefffa72a3763916d78f12b9e056fe (patch)
tree5b7a93c73b9f632ddea44d4989e3850e2c7a421c /Lib/inspect.py
parent8e21cc3ce010990b043068f0fab13e71c827341f (diff)
downloadcpython-3b23004112aefffa72a3763916d78f12b9e056fe.zip
cpython-3b23004112aefffa72a3763916d78f12b9e056fe.tar.gz
cpython-3b23004112aefffa72a3763916d78f12b9e056fe.tar.bz2
Issue #29354: Fixed inspect.getargs() for parameters which are cell
variables.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 6d645bd..0a6cfd7 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -769,8 +769,11 @@ def getargs(co):
if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'):
remain.append(value)
count.append(value)
- elif opname == 'STORE_FAST':
- stack.append(names[value])
+ elif opname in ('STORE_FAST', 'STORE_DEREF'):
+ if opname == 'STORE_FAST':
+ stack.append(names[value])
+ else:
+ stack.append(co.co_cellvars[value])
# Special case for sublists of length 1: def foo((bar))
# doesn't generate the UNPACK_TUPLE bytecode, so if