mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python move various theXXX() predicates into the appropriate module.
This commit is contained in:
@@ -67,9 +67,9 @@ predicate subscript(Stmt s) {
|
||||
predicate encode_decode(Expr ex, ClassObject type) {
|
||||
exists(string name |
|
||||
ex.(Call).getFunc().(Attribute).getName() = name |
|
||||
name = "encode" and type = builtin_object("UnicodeEncodeError")
|
||||
name = "encode" and type = Object::builtin("UnicodeEncodeError")
|
||||
or
|
||||
name = "decode" and type = builtin_object("UnicodeDecodeError")
|
||||
name = "decode" and type = Object::builtin("UnicodeDecodeError")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import python
|
||||
|
||||
/** Holds if `notimpl` refers to `NotImplemented` or `NotImplemented()` in the `raise` statement */
|
||||
predicate use_of_not_implemented_in_raise(Raise raise, Expr notimpl) {
|
||||
notimpl.refersTo(theNotImplementedObject()) and
|
||||
notimpl.refersTo(Object::notImplemented()) and
|
||||
(
|
||||
notimpl = raise.getException() or
|
||||
notimpl = raise.getException() or
|
||||
notimpl = raise.getException().(Call).getFunc()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
import python
|
||||
|
||||
FunctionObject iter() {
|
||||
result = builtin_object("iter")
|
||||
result = Object::builtin("iter")
|
||||
}
|
||||
|
||||
FunctionObject next() {
|
||||
result = builtin_object("next")
|
||||
result = Object::builtin("next")
|
||||
}
|
||||
|
||||
predicate call_to_iter(CallNode call, EssaVariable sequence) {
|
||||
|
||||
Reference in New Issue
Block a user