summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-23 06:10:44 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-07-23 06:10:44 (GMT)
commitf315c1c01676bfabb5b1c6628642668f1ef436a6 (patch)
tree078327f0ab7ab7c2a7ac347d9cb4669e98a6d201 /Lib
parent2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3 (diff)
downloadcpython-f315c1c01676bfabb5b1c6628642668f1ef436a6.zip
cpython-f315c1c01676bfabb5b1c6628642668f1ef436a6.tar.gz
cpython-f315c1c01676bfabb5b1c6628642668f1ef436a6.tar.bz2
Issue #24687: Plug refleak on SyntaxError in function parameters annotations.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_coroutines.py4
-rw-r--r--Lib/test/test_grammar.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 94994e5..14682ca 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -211,6 +211,10 @@ class AsyncBadSyntaxTest(unittest.TestCase):
pass
""",
+ """async def foo(a:await b):
+ pass
+ """,
+
"""def baz():
async def foo(a=await b):
pass
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index ca6b5d0..9b41df1 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -534,7 +534,8 @@ class GrammarTests(unittest.TestCase):
# Not allowed at class scope
check_syntax_error(self, "class foo:yield 1")
check_syntax_error(self, "class foo:yield from ()")
-
+ # Check annotation refleak on SyntaxError
+ check_syntax_error(self, "def g(a:(yield)): pass")
def test_raise(self):
# 'raise' test [',' test]