From 6d85f66ed7d814858ed229dc19f7e3d7a04f3b7f Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Mon, 31 Jul 2023 09:09:35 -0700 Subject: [PATCH] Fix new E721 flake8 warning --- pycheribuild/mtree.py | 2 +- pycheribuild/projects/cross/cheribsd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pycheribuild/mtree.py b/pycheribuild/mtree.py index 49e8bf057..6c51362d1 100644 --- a/pycheribuild/mtree.py +++ b/pycheribuild/mtree.py @@ -265,7 +265,7 @@ def exclude_matching(self, globs, exceptions=None, print_status=False) -> None: """Remove paths matching any pattern in globs (but not matching any in exceptions)""" if exceptions is None: exceptions = [] - if type(globs) == str: + if isinstance(globs, str): globs = [globs] for glob in globs + exceptions: # glob must be anchored at the root (./) or start with a pattern diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 59a722caf..45f2f31f8 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -127,7 +127,7 @@ def __init__(self, kernconf: str, platforms: "set[ConfigPlatform]", kernel_abi=K self.fett = fett def __repr__(self) -> str: - flags = [key for key, val in self.__dict__.items() if type(val) == bool and val] + flags = [key for key, val in self.__dict__.items() if isinstance(val, bool) and val] return "CheriBSDConfig({kernconf} {platform}:{kernel_abi} [{flags}])".format( kernconf=self.kernconf, platform=self.platforms, kernel_abi=self.kernel_abi.value, flags=" ".join(flags))