diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-07-24 08:07:38 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2018-07-24 08:07:38 +0200 |
commit | 530dbaf32d2f40068e05933480d93df3bb3c5854 (patch) | |
tree | 1a5cf88390bff8860fa2a02ea9ff93a1f90d0ffe /pyasn1/type | |
parent | 939be5fabe8c8ed8fcb334b07c84349f99cb0e59 (diff) | |
download | pyasn1-530dbaf32d2f40068e05933480d93df3bb3c5854.tar.gz |
Fix Sequence/Set.prettyPrint crash
When calling `.prettyPrint()` on Sequence/Set components,
make sure the component is a value object (not schema)
because calling `.prettyPrint` on a schema object is
likely to fail.
Diffstat (limited to 'pyasn1/type')
-rw-r--r-- | pyasn1/type/univ.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py index a19f6ba..898cf25 100644 --- a/pyasn1/type/univ.py +++ b/pyasn1/type/univ.py @@ -2457,7 +2457,7 @@ class SequenceAndSetBase(base.AbstractConstructedAsn1Item): scope += 1 representation = self.__class__.__name__ + ':\n' for idx, componentValue in enumerate(self._componentValues): - if componentValue is not noValue: + if componentValue is not noValue and componentValue.isValue: representation += ' ' * scope if self.componentType: representation += self.componentType.getNameByPosition(idx) |