File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 5
5
import textwrap
6
6
import tokenize
7
7
import warnings
8
- from ast import PyCF_ONLY_AST as _AST_FLAG
9
8
from bisect import bisect_right
10
9
from types import FrameType
11
10
from typing import Iterator
@@ -196,7 +195,7 @@ def compile(
196
195
newex .text = ex .text
197
196
raise newex
198
197
else :
199
- if flag & _AST_FLAG :
198
+ if flag & ast . PyCF_ONLY_AST :
200
199
return co
201
200
lines = [(x + "\n " ) for x in self .lines ]
202
201
# Type ignored because linecache.cache is private.
@@ -321,7 +320,7 @@ def getstatementrange_ast(
321
320
# don't produce duplicate warnings when compiling source to find ast
322
321
with warnings .catch_warnings ():
323
322
warnings .simplefilter ("ignore" )
324
- astnode = compile (content , "source" , "exec" , _AST_FLAG )
323
+ astnode = ast . parse (content , "source" , "exec" )
325
324
326
325
start , end = get_statement_startend2 (lineno , astnode )
327
326
# we need to correct the end:
You can’t perform that action at this time.
0 commit comments