Skip to content

Commit 66a0e15

Browse files
committed
Python: Modernise pyramid library
1 parent 59e09d6 commit 66a0e15

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

python/ql/src/semmle/python/web/pyramid/Redirect.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import semmle.python.security.TaintTracking
88
import semmle.python.security.strings.Basic
99
import semmle.python.web.Http
1010

11-
private ClassObject redirectClass() {
12-
exists(ModuleObject ex |
11+
private ClassValue redirectClass() {
12+
exists(ModuleValue ex |
1313
ex.getName() = "pyramid.httpexceptions" |
1414
ex.attr("HTTPFound") = result
1515
or
@@ -28,7 +28,7 @@ class PyramidRedirect extends HttpRedirectTaintSink {
2828

2929
PyramidRedirect() {
3030
exists(CallNode call |
31-
call.getFunction().refersTo(redirectClass())
31+
call.getFunction().pointsTo(redirectClass())
3232
|
3333
call.getArg(0) = this
3434
or

python/ql/src/semmle/python/web/pyramid/Response.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PyramidCookieSet extends CookieSet, CallNode {
3535
PyramidCookieSet() {
3636
exists(ControlFlowNode f |
3737
f = this.getFunction().(AttrNode).getObject("set_cookie") and
38-
f.refersTo(_, ModuleObject::named("pyramid").attr("Response"), _)
38+
f.pointsTo().getClass() = Value::named("pyramid.Response")
3939
)
4040
}
4141

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import python
22

3-
ModuleObject thePyramidViewModule() {
3+
ModuleValue thePyramidViewModule() {
44
result.getName() = "pyramid.view"
55
}
66

7-
Object thePyramidViewConfig() {
7+
Value thePyramidViewConfig() {
88
result = thePyramidViewModule().attr("view_config")
99
}
1010

1111
predicate is_pyramid_view_function(Function func) {
12-
func.getADecorator().refersTo(_, thePyramidViewConfig(), _)
12+
func.getADecorator().pointsTo().getClass() = thePyramidViewConfig()
1313
}
1414

0 commit comments

Comments
 (0)