File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,13 +30,11 @@ predicate uninitialized_local(NameNode use) {
3030predicate explicitly_guarded ( NameNode u ) {
3131 exists ( Try t |
3232 t .getBody ( ) .contains ( u .getNode ( ) ) and
33- t .getAHandler ( ) .getType ( ) .refersTo ( theNameErrorType ( ) )
33+ t .getAHandler ( ) .getType ( ) .pointsTo ( ClassValue :: nameError ( ) )
3434 )
3535}
3636
3737
3838from NameNode u
3939where uninitialized_local ( u ) and not explicitly_guarded ( u )
4040select u .getNode ( ) , "Local variable '" + u .getId ( ) + "' may be used before it is initialized."
41-
42-
Original file line number Diff line number Diff line change @@ -675,4 +675,9 @@ module ClassValue {
675675 result = TBuiltinClassObject ( Builtin:: special ( "NoneType" ) )
676676 }
677677
678+ /** Get the `ClassValue` for the `NameError` class. */
679+ ClassValue nameError ( ) {
680+ result = TBuiltinClassObject ( Builtin:: builtin ( "NameError" ) )
681+ }
682+
678683}
You can’t perform that action at this time.
0 commit comments