pyasn1
pyasn1 copied to clipboard
Stacktrace when enabling debugging
_componentValues can be NoValue in some situation, which makes debugging crash:
File "pyasn1/type/univ.py", line 2738, in prettyPrintType
for idx, componentType in enumerate(self.componentType.values() or self._componentValues):
I fixed the bug by changing this line: https://github.com/etingof/pyasn1/blob/db8f1a7930c6b5826357646746337dafc983f953/pyasn1/type/univ.py#L2722
to:
enum = self.componentType.values()
if not enum and not isinstance(self._componentValues,base.NoValue):
enum = self._componentValues
for idx, componentType in enumerate(enum):