X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=pyderasn.py;h=f563afef86964240e57971d85c91fa35d40de0c8;hp=32d942460436403c3bde2725f92aa370e63e715f;hb=5699682993d2c2b789640c20cd68e7bd1eb0cf7c;hpb=0265e9da3f3d6a84b79a231a7af0f694c7c96538 diff --git a/pyderasn.py b/pyderasn.py index 32d9424..f563afe 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