X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pyderasn.py;h=0b04f4eda76be9921b6de95d90e54d6c297e6e16;hb=a25f8f51af2b3a4277ce4fec1920b2cba3254aae;hp=c2d8f4409ee9f8d7b50a75956ed5d03a72b08db5;hpb=525b88f45577a5a63621e6621770752df8101c54;p=pyderasn.git diff --git a/pyderasn.py b/pyderasn.py index c2d8f44..0b04f4e 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 # PyDERASN -- Python ASN.1 DER/BER codec with abstract structures -# Copyright (C) 2017-2019 Sergey Matveev +# Copyright (C) 2017-2020 Sergey Matveev # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as @@ -673,6 +673,7 @@ except ImportError: # pragma: no cover def colored(what, *args, **kwargs): return what +__version__ = "5.5" __all__ = ( "Any", @@ -4885,8 +4886,8 @@ class Sequence(Obj): ctx=ctx, _ctx_immutable=False, ) - except TagMismatch: - if spec.optional: + except TagMismatch as err: + if (len(err.decode_path) == len(decode_path) + 1) and spec.optional: continue raise