pyasn1 icon indicating copy to clipboard operation
pyasn1 copied to clipboard

Stacktrace when enabling debugging

Open ptitdoc opened this issue 4 years ago • 0 comments

_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):

ptitdoc avatar Jun 25 '21 14:06 ptitdoc