Skip to content

Commit 64ff638

Browse files
authored
fix mypy lint
1 parent 69bd25b commit 64ff638

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/_pyrepl/console.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from __future__ import annotations
2121

2222
import _colorize
23-
import _symtable
23+
import _symtable # type: ignore[import-not-found]
2424

2525
from abc import ABC, abstractmethod
2626
import ast
@@ -214,11 +214,11 @@ def runsource(self, source, filename="<input>", symbol="single"):
214214
self.showsyntaxerror(filename, source=source)
215215
return False
216216

217+
# validate stuff that cannot be validated with AST parsing only
218+
flags = self.compile.compiler.flags
219+
flags &= ~codeop.PyCF_DONT_IMPLY_DEDENT
220+
flags &= ~codeop.PyCF_ALLOW_INCOMPLETE_INPUT
217221
try:
218-
# validate stuff that cannot be validated with AST parsing only
219-
flags = self.compile.compiler.flags
220-
flags &= ~codeop.PyCF_DONT_IMPLY_DEDENT
221-
flags &= ~codeop.PyCF_ALLOW_INCOMPLETE_INPUT
222222
_symtable.symtable(source, filename, "exec", flags=flags)
223223
except (SyntaxError, OverflowError, ValueError):
224224
self.showsyntaxerror(filename, source=source)

0 commit comments

Comments
 (0)