Merge pull request #3551 from RasmusWL/python-fix-upcoming-deprecation

Python: Fix (upcoming) deprecation compiler-warnings
This commit is contained in:
Taus
2020-05-25 16:17:57 +02:00
committed by GitHub
3 changed files with 5 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ predicate contains_unknown_import_star(ModuleValue m) {
from ModuleValue m, StrConst name, string exported_name
where
declaredInAll(m.getScope(), name) and
exported_name = name.strValue() and
exported_name = name.getText() and
not m.hasAttribute(exported_name) and
not is_exported_submodule_name(m, exported_name) and
not contains_unknown_import_star(m) and

View File

@@ -597,7 +597,7 @@ class StrConst extends Str_, ImmutableLiteral {
this.getEnclosingModule().hasFromFuture("unicode_literals")
}
override string strValue() { result = this.getS() }
deprecated override string strValue() { result = this.getS() }
override Expr getASubExpression() { none() }

View File

@@ -118,7 +118,7 @@ class BuiltinModuleObject extends ModuleObject {
override predicate hasAttribute(string name) { exists(this.asBuiltin().getMember(name)) }
override predicate exportsComplete() { any() }
deprecated override predicate exportsComplete() { any() }
}
class PythonModuleObject extends ModuleObject {
@@ -132,7 +132,7 @@ class PythonModuleObject extends ModuleObject {
override Container getPath() { result = this.getModule().getFile() }
override predicate exportsComplete() {
deprecated override predicate exportsComplete() {
exists(Module m | m = this.getModule() |
not exists(Call modify, Attribute attr, GlobalVariable all |
modify.getScope() = m and
@@ -196,7 +196,7 @@ class PackageObject extends ModuleObject {
)
}
override predicate exportsComplete() {
deprecated override predicate exportsComplete() {
not exists(this.getInitModule())
or
this.getInitModule().exportsComplete()