summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-03-15 14:24:25 (GMT)
committerGitHub <noreply@github.com>2021-03-15 14:24:25 (GMT)
commitc5440937efab6a99d54340c902dfb21e86874bc3 (patch)
tree5f9e2fdfb14ba0a400dc5ae32d1c699658b04e00 /Lib
parent35d5068928ab5485e5f28b60b1e33062bc2c46cc (diff)
downloadcpython-c5440937efab6a99d54340c902dfb21e86874bc3.zip
cpython-c5440937efab6a99d54340c902dfb21e86874bc3.tar.gz
cpython-c5440937efab6a99d54340c902dfb21e86874bc3.tar.bz2
Mark POP_TOP at end of expression statement as artificial, to conform to PEP 626. (GH-24860)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_compile.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index aa08c97..591d5bb 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -786,6 +786,14 @@ if 1:
self.assertIn('LOAD_', opcodes[0].opname)
self.assertEqual('RETURN_VALUE', opcodes[1].opname)
+ def test_lineno_procedure_call(self):
+ def call():
+ (
+ print()
+ )
+ line1 = call.__code__.co_firstlineno + 1
+ assert line1 not in [line for (_, _, line) in call.__code__.co_lines()]
+
def test_lineno_after_implicit_return(self):
TRUE = True
# Don't use constant True or False, as compiler will remove test