summaryrefslogtreecommitdiff
path: root/Lib/test/test_code.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-04 05:09:28 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-04 05:09:28 +0000
commit0cbd805a10b91f803bccbb5a54f8e54c2e40e9e8 (patch)
tree62229621195dcaf1c38378924227066697ef8643 /Lib/test/test_code.py
parent4ffedadb1032a4310e756d476310d056ad209310 (diff)
downloadcpython-git-0cbd805a10b91f803bccbb5a54f8e54c2e40e9e8.tar.gz
Bug #1333982: string/number constants were inappropriately stored
in the byte code and co_consts even if they were not used, ie immediately popped off the stack.
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r--Lib/test/test_code.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 52bc8948b9..4e68638569 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -61,6 +61,23 @@ nlocals: 1
flags: 67
consts: ('None',)
+>>> def optimize_away():
+... 'doc string'
+... 'not a docstring'
+... 53
+... 53L
+
+>>> dump(optimize_away.func_code)
+name: optimize_away
+argcount: 0
+names: ()
+varnames: ()
+cellvars: ()
+freevars: ()
+nlocals: 0
+flags: 67
+consts: ("'doc string'", 'None')
+
"""
def consts(t):