All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] semanage: use instance check
@ 2023-08-07 18:55 Christian Göttsche
  2023-08-08 10:30 ` Petr Lautrbach
  2023-08-08 18:32 ` James Carter
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Göttsche @ 2023-08-07 18:55 UTC (permalink / raw)
  To: selinux

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()`
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
This currently breaks the GitHub CI.
---
 python/semanage/seobject.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
index 361205d1..cc944ae2 100644
--- a/python/semanage/seobject.py
+++ b/python/semanage/seobject.py
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] semanage: use instance check
  2023-08-07 18:55 [RFC PATCH] semanage: use instance check Christian Göttsche
@ 2023-08-08 10:30 ` Petr Lautrbach
  2023-08-08 18:32 ` James Carter
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Lautrbach @ 2023-08-08 10:30 UTC (permalink / raw)
  To: Christian Göttsche, selinux

Christian Göttsche <cgzones@googlemail.com> writes:

> 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()`
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>


Thanks, but it's already proposed

https://lore.kernel.org/selinux/20230803134024.20849-1-jwcart2@gmail.com/T/#u


> ---
> This currently breaks the GitHub CI.
> ---
>  python/semanage/seobject.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
> index 361205d1..cc944ae2 100644
> --- a/python/semanage/seobject.py
> +++ b/python/semanage/seobject.py
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] semanage: use instance check
  2023-08-07 18:55 [RFC PATCH] semanage: use instance check Christian Göttsche
  2023-08-08 10:30 ` Petr Lautrbach
@ 2023-08-08 18:32 ` James Carter
  1 sibling, 0 replies; 3+ messages in thread
From: James Carter @ 2023-08-08 18:32 UTC (permalink / raw)
  To: Christian Göttsche; +Cc: selinux

On Mon, Aug 7, 2023 at 3:40 PM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> 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()`
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

Another patch just like this has been merged.
Thanks,
Jim

> ---
> This currently breaks the GitHub CI.
> ---
>  python/semanage/seobject.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
> index 361205d1..cc944ae2 100644
> --- a/python/semanage/seobject.py
> +++ b/python/semanage/seobject.py
> @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-08 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07 18:55 [RFC PATCH] semanage: use instance check Christian Göttsche
2023-08-08 10:30 ` Petr Lautrbach
2023-08-08 18:32 ` James Carter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.