diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index 4dc20e1..01561e0 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/src/cryptobox/core/blockdevice.py @@ -741,8 +741,12 @@ class Blockdevice: output += "\tflags:\t\t" for funcname in [ func for func in dir(self) if func.startswith("is_") and callable(getattr(self, func))]: - if getattr(self, funcname)(): - output += "%s " % funcname[3:] + try: + if getattr(self, funcname)(): + output += "%s " % funcname[3:] + except TypeError: + # skip tests that need arguments (e.g. "is_parent_of") + pass output += "\n" return output @@ -1003,7 +1007,11 @@ if __name__ == '__main__': for check in flag_checker: show("List of '%s' devices:" % check[3:]) for device in blocks: - if getattr(device, check)(): - show("\t%s" % device) + try: + if getattr(device, check)(): + show("\t%s" % device) + except TypeError: + # ignore tests that need a second argument + pass show()