Skip to content

Commit 769dba1

Browse files
authored
SONARPY-1339: Fix FP on S5644 on ModuleType.__path__ (#1543)
1 parent 4037363 commit 769dba1

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

python-checks/src/test/resources/checks/itemOperationsTypeCheck/itemOperations_delitem.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,9 @@ class MetaclassedWithoutDelete(metaclass=MyMetaClassWithoutDelete):
158158

159159
del MetaclassedWithoutDelete[0] # FN
160160
del MetaclassedWithoutDelete()[0] # FN
161+
162+
163+
def import_path():
164+
from importlib import import_module
165+
166+
del import_module('importlib').__path__[0] # OK ref: SONARPY-1339

python-checks/src/test/resources/checks/itemOperationsTypeCheck/itemOperations_getitem.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,9 @@ class A(Future[TSource]): ...
192192

193193
def python3_10():
194194
type_alias = type[Exception]
195+
196+
197+
def import_path():
198+
from importlib import import_module
199+
200+
path = import_module('importlib').__path__[0] # OK ref: SONARPY-1339

python-checks/src/test/resources/checks/itemOperationsTypeCheck/itemOperations_setitem.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,9 @@ class MetaclassedWithoutSet(metaclass=MyMetaClassWithoutSet): ...
157157

158158
MetaclassedWithoutSet[0] = 42 # FN
159159
MetaclassedWithoutSet()[0] = 42 # FN
160+
161+
162+
def import_path():
163+
from importlib import import_module
164+
165+
import_module('importlib').__path__[0] = "test" # OK ref: SONARPY-1339

0 commit comments

Comments
 (0)