mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #3551 from RasmusWL/python-fix-upcoming-deprecation
Python: Fix (upcoming) deprecation compiler-warnings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() }
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user