X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=d3b304ca8d3cb452b2adf2733b44c2d33dc27684;hb=da5a0a12429fb8466d0fc6d6a85ad4ed2056f792;hp=32d942460436403c3bde2725f92aa370e63e715f;hpb=0265e9da3f3d6a84b79a231a7af0f694c7c96538;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index 32d9424..d3b304c 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -2310,7 +2310,7 @@ class BitString(Obj): if not frozenset(value) <= SET01: raise ValueError("B's coding contains unacceptable chars") return self._bits2octets(value) - elif value.endswith("'H"): + if value.endswith("'H"): value = value[1:-2] return ( len(value) * 4, @@ -2318,8 +2318,7 @@ class BitString(Obj): ) if isinstance(value, binary_type): return (len(value) * 8, value) - else: - raise InvalidValueType((self.__class__, string_types, binary_type)) + raise InvalidValueType((self.__class__, string_types, binary_type)) if isinstance(value, tuple): if ( len(value) == 2 and @@ -4753,9 +4752,8 @@ class Sequence(Obj): if spec.optional: continue return False - else: - if not value.ready: - return False + if not value.ready: + return False return True @property @@ -5754,7 +5752,7 @@ def main(): # pragma: no cover print(pprinter( obj, oid_maps=oid_maps, - with_colours=True if environ.get("NO_COLOR") is None else False, + with_colours=environ.get("NO_COLOR") is None, with_decode_path=args.print_decode_path, decode_path_only=( () if args.decode_path_only is None else