Skip to content

Commit 7716cff

Browse files
authored
Merge pull request github#3551 from RasmusWL/python-fix-upcoming-deprecation
Python: Fix (upcoming) deprecation compiler-warnings
2 parents 8146073 + 6ce1b9f commit 7716cff

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

python/ql/src/Variables/UndefinedExport.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ predicate contains_unknown_import_star(ModuleValue m) {
5959
from ModuleValue m, StrConst name, string exported_name
6060
where
6161
declaredInAll(m.getScope(), name) and
62-
exported_name = name.strValue() and
62+
exported_name = name.getText() and
6363
not m.hasAttribute(exported_name) and
6464
not is_exported_submodule_name(m, exported_name) and
6565
not contains_unknown_import_star(m) and

python/ql/src/semmle/python/Exprs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ class StrConst extends Str_, ImmutableLiteral {
597597
this.getEnclosingModule().hasFromFuture("unicode_literals")
598598
}
599599

600-
override string strValue() { result = this.getS() }
600+
deprecated override string strValue() { result = this.getS() }
601601

602602
override Expr getASubExpression() { none() }
603603

python/ql/src/semmle/python/types/ModuleObject.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class BuiltinModuleObject extends ModuleObject {
118118

119119
override predicate hasAttribute(string name) { exists(this.asBuiltin().getMember(name)) }
120120

121-
override predicate exportsComplete() { any() }
121+
deprecated override predicate exportsComplete() { any() }
122122
}
123123

124124
class PythonModuleObject extends ModuleObject {
@@ -132,7 +132,7 @@ class PythonModuleObject extends ModuleObject {
132132

133133
override Container getPath() { result = this.getModule().getFile() }
134134

135-
override predicate exportsComplete() {
135+
deprecated override predicate exportsComplete() {
136136
exists(Module m | m = this.getModule() |
137137
not exists(Call modify, Attribute attr, GlobalVariable all |
138138
modify.getScope() = m and
@@ -196,7 +196,7 @@ class PackageObject extends ModuleObject {
196196
)
197197
}
198198

199-
override predicate exportsComplete() {
199+
deprecated override predicate exportsComplete() {
200200
not exists(this.getInitModule())
201201
or
202202
this.getInitModule().exportsComplete()

0 commit comments

Comments
 (0)