Re: [RFC PATCH] semanage: use instance check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Göttsche <cgzones@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>


Thanks, but it's already proposed

https://lore.kernel.org/selinux/20230803134024.20849-1-jwcart2@xxxxxxxxx/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





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux