diff options
-rw-r--r-- | pysnmp/smi/mibs/SNMPv2-TC.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py index e7a9f031..2c4edb73 100644 --- a/pysnmp/smi/mibs/SNMPv2-TC.py +++ b/pysnmp/smi/mibs/SNMPv2-TC.py @@ -262,7 +262,9 @@ class TextualConvention: 'd': octets.str2octs(string.digits) } - if octets.isStringType(value): + # how do we know if object is initialized with display-hint + # formatted text? based on "text" input maybe? + if octets.isStringType(value) and not octets.isOctetsType(value): value = base.prettyIn(self, value) else: return base.prettyIn(self, value) @@ -303,7 +305,7 @@ class TextualConvention: displayFormat = displayHint[0] displayHint = displayHint[1:] - # 4 this is the lifesaver -- we could cut by it + # 4 this is the lifesaver -- we could use it as an anchor if displayHint and displayHint[0] not in string.digits and displayHint[0] != '*': displaySep = displayHint[0] displayHint = displayHint[1:] |