semanage: use instance check
RFC PATCH 1/1 semanage: use instance check
Please flake8:
./python/semanage/seobject.py:250:16: E721 do not compare types, for exact checks use is / is not, for instance checks use isinstance()
---
This currently breaks the GitHub CI.
--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
python/semanage/seobject.py +1 -1
@@ -247,7 +247,7 @@ class semanageRecords: global handle if args: # legacy code - args was store originally - if type(args) == str: + if isinstance(args, str): self.store = args else: self.args = args
Signature · 1 line
2.40.1
Quoted 4 lines · Christian Göttsche
Please flake8:
./python/semanage/seobject.py:250:16: E721 do not compare types, for exact checks useis/is not, for instance checks useisinstance()Signed-off-by Christian Göttsche <[email protected]>
Thanks, but it's already proposed
https://lore.kernel.org/selinux/[email protected]/T/#u
Quoted 21 lines
---
This currently breaks the GitHub CI.--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)python/semanage/seobject.py +1
-1@@ -247,7 +247,7 @@ class semanageRecords: global handle if args: # legacy code - args was store originally - if type(args) == str: + if isinstance(args, str): self.store = args else: self.args = argsSignature · 1 line
2.40.1
Quoted 5 lines · Christian Göttsche
Please flake8:
./python/semanage/seobject.py:250:16: E721 do not compare types, for exact checks useis/is not, for instance checks useisinstance()Signed-off-by Christian Göttsche <[email protected]>
Another patch just like this has been merged.
Thanks,
Jim
Quoted 22 lines
---
This currently breaks the GitHub CI.--- python/semanage/seobject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)python/semanage/seobject.py +1
-2@@ -247,7 +247,7 @@ class semanageRecords: global handle if args: # legacy code - args was store originally - if type(args) == str: + if isinstance(args, str): self.store = args else: self.args = args --2.40.1