diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-03-19 11:40:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-19 11:40:12 +0100 |
commit | 774dff0e3546baca37ba38591878a317eb6da8bc (patch) | |
tree | 26de4145c71a88080dcd428a88c43ecb9de78a58 /pysnmp/smi/mibs | |
parent | 708062acdea970883a7c7de465f719451012ad6f (diff) | |
download | pysnmp-git-774dff0e3546baca37ba38591878a317eb6da8bc.tar.gz |
Fix to infinite recursion in TextualConvention.prettyIn() (#48)
* fix to infinite recursion in TextualConvention.prettyIn()
Also, TextualConvention is now a new-style class
Diffstat (limited to 'pysnmp/smi/mibs')
-rw-r--r-- | pysnmp/smi/mibs/SNMPv2-TC.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py index 9df2f586..17d3e2d0 100644 --- a/pysnmp/smi/mibs/SNMPv2-TC.py +++ b/pysnmp/smi/mibs/SNMPv2-TC.py @@ -29,8 +29,7 @@ Counter32, Unsigned32, TimeTicks, Counter64 = mibBuilder.importSymbols( ) -# XXX keep this old-style class till pyasn1 types becomes new-style -class TextualConvention: +class TextualConvention(object): displayHint = '' status = 'current' description = '' @@ -184,7 +183,7 @@ class TextualConvention: return outputValue for base in inspect.getmro(self.__class__): - if base != self.__class__ and issubclass(base, Asn1Item): + if not issubclass(base, TextualConvention) and issubclass(base, Asn1Item): return base.prettyOut(self, value) raise SmiError('TEXTUAL-CONVENTION has no underlying SNMP base type') @@ -200,7 +199,7 @@ class TextualConvention: input meaning `unicode` (Py2) or `str` (Py3). """ for base in inspect.getmro(self.__class__): - if base != self.__class__ and issubclass(base, Asn1Item): + if not issubclass(base, TextualConvention) and issubclass(base, Asn1Item): break else: raise SmiError('TEXTUAL-CONVENTION has no underlying SNMP base type') |