aboutsummaryrefslogtreecommitdiff
path: root/pyasn1/type
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-08-23 18:57:42 +0200
committerIlya Etingof <etingof@gmail.com>2017-08-23 18:57:42 +0200
commit4a1d2679cd9644a69a880397a4c4e67d07e6080b (patch)
tree449a41f8c7d3b5215e119d11db91bcfc62ecea57 /pyasn1/type
parent748429c2a4c3a960fe009da67421e20b27086a86 (diff)
downloadpyasn1-4a1d2679cd9644a69a880397a4c4e67d07e6080b.tar.gz
fixed crash at Sequence.prettyPrint() with no components
Diffstat (limited to 'pyasn1/type')
-rw-r--r--pyasn1/type/univ.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyasn1/type/univ.py b/pyasn1/type/univ.py
index 67d8b14..8abbab5 100644
--- a/pyasn1/type/univ.py
+++ b/pyasn1/type/univ.py
@@ -2294,7 +2294,10 @@ class SequenceAndSetBase(base.AbstractConstructedAsn1Item):
for idx, componentValue in enumerate(self._componentValues):
if componentValue is not noValue:
representation += ' ' * scope
- representation += self.componentType.getNameByPosition(idx)
+ if self.componentType:
+ representation += self.componentType.getNameByPosition(idx)
+ else:
+ representation += 'field-%d' % idx
representation = '%s=%s\n' % (
representation, componentValue.prettyPrint(scope)
)