From 530dbaf32d2f40068e05933480d93df3bb3c5854 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Tue, 24 Jul 2018 08:07:38 +0200 Subject: 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. --- pyasn1/type/univ.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyasn1/type') 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) -- cgit v1.2.3