@@ -206,7 +206,7 @@ class SemanticAnalyzer(NodeVisitor[None],
206206 patches = None # type: List[Tuple[int, Callable[[], None]]]
207207 loop_depth = 0 # Depth of breakable loops
208208 cur_mod_id = '' # Current module id (or None) (phase 2)
209- is_stub_file = False # Are we analyzing a stub file?
209+ _is_stub_file = False # Are we analyzing a stub file?
210210 _is_typeshed_stub_file = False # Are we analyzing a typeshed stub file?
211211 imports = None # type: Set[str] # Imported modules (during phase 2 analysis)
212212 # Note: some imports (and therefore dependencies) might
@@ -280,6 +280,10 @@ def __init__(self,
280280
281281 # mypyc doesn't properly handle implementing an abstractproperty
282282 # with a regular attribute so we make them properties
283+ @property
284+ def is_stub_file (self ) -> bool :
285+ return self ._is_stub_file
286+
283287 @property
284288 def is_typeshed_stub_file (self ) -> bool :
285289 return self ._is_typeshed_stub_file
@@ -507,7 +511,7 @@ def file_context(self,
507511 self .cur_mod_node = file_node
508512 self .cur_mod_id = file_node .fullname
509513 scope .enter_file (self .cur_mod_id )
510- self .is_stub_file = file_node .path .lower ().endswith ('.pyi' )
514+ self ._is_stub_file = file_node .path .lower ().endswith ('.pyi' )
511515 self ._is_typeshed_stub_file = is_typeshed_file (file_node .path )
512516 self .globals = file_node .names
513517 self .tvar_scope = TypeVarLikeScope ()
0 commit comments