diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-12-29 21:02:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-29 21:02:53 +0100 |
commit | 7b6c498ac1faaec366690ed681fc12ad9de3d1f3 (patch) | |
tree | 889e42c9e37677cca6bf597b2972b5703b3c20b4 /pyasn1/type | |
parent | 19f1cf536da6305c4dfab65a1b6ac269dab6c186 (diff) | |
download | pyasn1-7b6c498ac1faaec366690ed681fc12ad9de3d1f3.tar.gz |
Fix defaulted constructed SEQUENCE component initialization (#146)
When SEQUENCE has defaulted component of constructed type,
recursively instantiate defaulted component and assign instantiated
asn1 object to SEQUENCE field.
Diffstat (limited to 'pyasn1/type')
-rw-r--r-- | pyasn1/type/univ.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index 898cf25..492a118 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -2347,7 +2347,9 @@ class SequenceAndSetBase(base.AbstractConstructedAsn1Item): if value is noValue: if componentTypeLen: - value = componentType.getTypeByPosition(idx).clone() + value = componentType.getTypeByPosition(idx) + if isinstance(value, base.AbstractConstructedAsn1Item): + value = value.clone(cloneValueFlag=componentType[idx].isDefaulted) elif currentValue is noValue: raise error.PyAsn1Error('Component type not defined') |