mirror of
https://github.com/github/codeql.git
synced 2026-03-31 12:48:17 +02:00
Python: Select property instead of function
in PropertyInOldStyleClass. This matches the previous behaviour more closely.
This commit is contained in:
@@ -13,11 +13,12 @@
|
||||
import python
|
||||
private import semmle.python.dataflow.new.internal.DataFlowDispatch
|
||||
|
||||
from Function prop, Class cls
|
||||
from Function prop, Class cls, Name decorator
|
||||
where
|
||||
prop.getScope() = cls and
|
||||
prop.getADecorator().(Name).getId() = "property" and
|
||||
decorator = prop.getADecorator() and
|
||||
decorator.getId() = "property" and
|
||||
not DuckTyping::isNewStyle(cls)
|
||||
select prop,
|
||||
select decorator,
|
||||
"Property " + prop.getName() + " will not work properly, as class " + cls.getName() +
|
||||
" is an old-style class."
|
||||
|
||||
@@ -1 +1 @@
|
||||
| property_old_style.py:9:5:9:20 | Function piosc | Property piosc will not work properly, as class OldStyle is an old-style class. |
|
||||
| property_old_style.py:8:6:8:13 | property | Property piosc will not work properly, as class OldStyle is an old-style class. |
|
||||
|
||||
Reference in New Issue
Block a user