]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - pyderasn.py
is comparison is slightly faster
[pyderasn.git] / pyderasn.py
index ed5b763ccef4123c790d52569d9b376ef2acf168..fcaa5a6cdcce2e4057305b5cc37f0c9ffa164913 100755 (executable)
@@ -666,6 +666,7 @@ from math import ceil
 from os import environ
 from string import ascii_letters
 from string import digits
+from sys import version_info
 from unicodedata import category as unicat
 
 from six import add_metaclass
@@ -690,7 +691,7 @@ except ImportError:  # pragma: no cover
     def colored(what, *args, **kwargs):
         return what
 
-__version__ = "6.2"
+__version__ = "6.3"
 
 __all__ = (
     "Any",
@@ -764,7 +765,7 @@ EOC = b"\x00\x00"
 EOC_LEN = len(EOC)
 LENINDEF = b"\x80"  # length indefinite mark
 LENINDEF_PP_CHAR = "I" if PY2 else "∞"
-NAMEDTUPLE_KWARGS = {} if PY2 else {"module": __name__}
+NAMEDTUPLE_KWARGS = {} if version_info < (3, 6) else {"module": __name__}
 SET01 = frozenset("01")
 DECIMALS = frozenset(digits)
 DECIMAL_SIGNS = ".,"
@@ -5133,7 +5134,7 @@ def get_def_by_path(defines_by_path, sub_decode_path):
         if len(path) != len(sub_decode_path):
             continue
         for p1, p2 in zip(path, sub_decode_path):
-            if (p1 != any) and (p1 != p2):
+            if (not p1 is any) and (p1 != p2):
                 break
         else:
             return define