]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - pyderasn.py
Add PEP-396 compatible module's __version__
[pyderasn.git] / pyderasn.py
index c2d8f4409ee9f8d7b50a75956ed5d03a72b08db5..0b04f4eda76be9921b6de95d90e54d6c297e6e16 100755 (executable)
@@ -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 <stargrave@stargrave.org>
+# Copyright (C) 2017-2020 Sergey Matveev <stargrave@stargrave.org>
 #
 # 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