File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1414import python
1515
1616/** Whether name is declared in the __all__ list of this module */
17- predicate declaredInAll ( Module m , StrConst name )
18- {
19- exists ( Assign a , GlobalVariable all |
20- a .defines ( all ) and a .getScope ( ) = m and
21- all .getId ( ) = "__all__" and ( ( List ) a .getValue ( ) ) .getAnElt ( ) = name
17+ predicate declaredInAll ( Module m , StrConst name ) {
18+ exists ( Assign a , GlobalVariable all |
19+ a .defines ( all ) and
20+ a .getScope ( ) = m and
21+ all .getId ( ) = "__all__" and
22+ a .getValue ( ) .( List ) .getAnElt ( ) = name
2223 )
2324}
2425
2526predicate mutates_globals ( ModuleValue m ) {
2627 exists ( CallNode globals |
2728 globals = Object:: builtin ( "globals" ) .( FunctionObject ) .getACall ( ) and
28- globals .getScope ( ) = m .getScope ( ) |
29+ globals .getScope ( ) = m .getScope ( )
30+ |
2931 exists ( AttrNode attr | attr .getObject ( ) = globals )
3032 or
3133 exists ( SubscriptNode sub | sub .getValue ( ) = globals and sub .isStore ( ) )
3234 )
3335 or
3436 exists ( Object enum_convert |
3537 enum_convert .hasLongName ( "enum.Enum._convert" ) and
36- exists ( CallNode call |
37- call .getScope ( ) = m .getScope ( )
38- |
38+ exists ( CallNode call | call .getScope ( ) = m .getScope ( ) |
3939 enum_convert .( FunctionObject ) .getACall ( ) = call or
4040 call .getFunction ( ) .refersTo ( enum_convert )
4141 )
You can’t perform that action at this time.
0 commit comments