Python: Fix (upcoming) deprecation compiler-warnings

In a near-future release overriding a deprecated predicate without making as
deprecated would give a compiler warning.

Not fixing the XML one. [I can see that this shouldn't be reported
anymore](https://github.com/github/codeql/pull/3520#issuecomment-631552943), and
it's not safe to remove since it was only marked as deprecated in
e6425bb4cf.
This commit is contained in:
Rasmus Wriedt Larsen 2020-05-25 11:05:30 +02:00
Родитель b9ecf1a304
Коммит 32c8dd0491
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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()