]> granicus.if.org Git - python/commit
bpo-36052: Raise a SyntaxError when assigning a value to __debug__ with := (GH-11958)
authorStéphane Wirtel <stephane@wirtel.be>
Thu, 21 Feb 2019 10:11:53 +0000 (11:11 +0100)
committerPablo Galindo <Pablogsal@gmail.com>
Thu, 21 Feb 2019 10:11:53 +0000 (10:11 +0000)
commit3ad91673057d410bf9f8c53df6bb8aa18c4b68ca
treeca2e9969eec7990a9a91061e5b2814a08aee5dd5
parentea6207d593832fe50dbca39e94c138abbd5d266d
bpo-36052: Raise a SyntaxError when assigning a value to __debug__ with := (GH-11958)

Trying to assign a value to __debug__ using the assignment operator is supposed to fail, but
a missing check for forbidden names when setting the context in the ast was preventing this behaviour.
Lib/test/test_syntax.py
Misc/NEWS.d/next/Core and Builtins/2019-02-20-17-57-31.bpo-36052.l8lJSi.rst [new file with mode: 0644]
Python/ast.c