File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 233
233
234
234
SINGLETON_VALUES = {True , False , None }
235
235
236
+ TERMINATING_FUNCS_QNAMES = frozenset (
237
+ {"_sitebuiltins.Quitter" , "sys.exit" , "posix._exit" , "nt._exit" }
238
+ )
239
+
236
240
237
241
class NoSuchArgumentError (Exception ):
238
242
pass
@@ -2149,11 +2153,12 @@ def is_terminating_func(node: nodes.Call) -> bool:
2149
2153
):
2150
2154
return False
2151
2155
2152
- qnames = {"_sitebuiltins.Quitter" , "sys.exit" , "posix._exit" , "nt._exit" }
2153
-
2154
2156
try :
2155
2157
for inferred in node .func .infer ():
2156
- if hasattr (inferred , "qname" ) and inferred .qname () in qnames :
2158
+ if (
2159
+ hasattr (inferred , "qname" )
2160
+ and inferred .qname () in TERMINATING_FUNCS_QNAMES
2161
+ ):
2157
2162
return True
2158
2163
except (StopIteration , astroid .InferenceError ):
2159
2164
pass
You can’t perform that action at this time.
0 commit comments