mirror of
https://github.com/python/cpython.git
synced 2025-11-10 10:32:04 +00:00
bpo-41520: Fix second codeop regression (GH-21848)
* bpo-41520: Fix second codeop repression Fix the repression introduced by the initial regression fix.
This commit is contained in:
parent
46d10b1237
commit
c818b15fa5
3 changed files with 11 additions and 8 deletions
|
|
@ -85,9 +85,9 @@ def _maybe_compile(compiler, source, filename, symbol):
|
|||
pass
|
||||
|
||||
# Catch syntax warnings after the first compile
|
||||
# to emit SyntaxWarning at most once.
|
||||
# to emit warnings (SyntaxWarning, DeprecationWarning) at most once.
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("error", SyntaxWarning)
|
||||
warnings.simplefilter("error")
|
||||
|
||||
try:
|
||||
code1 = compiler(source + "\n", filename, symbol)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue