diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-11-17 23:24:44 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-11-17 23:24:44 +0100 |
commit | a0b1a80510410784f39c6fd21a70b66bab14cc0a (patch) | |
tree | 59571d02fdfe3c95bd2daa3fc8b80f0475f3c4ad | |
parent | 394804bf9e064c2b530208c9470564d1b3e0c0ef (diff) | |
download | pyasn1-git-a0b1a80510410784f39c6fd21a70b66bab14cc0a.tar.gz |
fix to NamedTypes methods to handle .getTagMap() returning None
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | pyasn1/type/namedtype.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 32a7e5d..9900137 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -26,6 +26,7 @@ Revision 0.1.10, released XX-XX-2016 constraints are wrapped in ConstraintsIntersection composite, additional constraints being added on subtyping effectively further narrow the set of allowed values, which aligns well with the notion of subtyping. +- Fix to NamedTypes methods to handle .getTagMap() returning None Revision 0.1.9, released 28-09-2015 ----------------------------------- diff --git a/pyasn1/type/namedtype.py b/pyasn1/type/namedtype.py index 5e1e292..45a95cf 100644 --- a/pyasn1/type/namedtype.py +++ b/pyasn1/type/namedtype.py @@ -131,7 +131,7 @@ class NamedTypes(object): idx = self.__namedTypesLen while idx > 0: idx -= 1 - tagMap = self.__namedTypes[idx].getType().getTagMap() + tagMap = self.__namedTypes[idx].getType().getTagMap() or tagmap.TagMap() for t in tagMap.getPosMap(): if t in self.__tagToPosIdx: raise error.PyAsn1Error('Duplicate type %s' % (t,)) @@ -203,7 +203,7 @@ class NamedTypes(object): tagMap = tagmap.TagMap() for nt in self.__namedTypes: tagMap = tagMap.clone( - nt.getType(), nt.getType().getTagMap(), uniq + nt.getType(), nt.getType().getTagMap() or tagmap.TagMap(), uniq ) self.__tagMap[uniq] = tagMap return self.__tagMap[uniq] |