Skip to content

Commit

Permalink
python: Use isinstance() instead of type()
Browse files Browse the repository at this point in the history
CI testing fails while running flake8 on python scripts with the
message "./python/semanage/seobject.py:250:16: E721 do not compare
types, for exact checks use `is` / `is not`, for instance checks use
`isinstance()`"

Use "isinstance(args, str)" instead of "type(args) == str"

Signed-off-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
jwcart2 authored and bachradsusi committed Aug 8, 2023
1 parent 1c19dc4 commit dba6e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/semanage/seobject.py
Expand Up @@ -247,7 +247,7 @@ def __init__(self, args = None):
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
Expand Down

0 comments on commit dba6e0c

Please sign in to comment.