summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2017-02-04 19:31:53 +0100
committerIlya Etingof <etingof@gmail.com>2017-02-04 19:31:53 +0100
commitfd237891ce46a4d779ba148fc35574bb65d8b9b6 (patch)
tree2ce25365871f63c0b80d67911fd10f3823438605
parent4fdba5575917df54b010288516aba1a65e55227c (diff)
downloadpysnmp-git-fd237891ce46a4d779ba148fc35574bb65d8b9b6.tar.gz
do not require dot in "d" spec of DISPLAY-HINT
-rw-r--r--pysnmp/smi/mibs/SNMPv2-TC.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pysnmp/smi/mibs/SNMPv2-TC.py b/pysnmp/smi/mibs/SNMPv2-TC.py
index cc6184a8..9df2f586 100644
--- a/pysnmp/smi/mibs/SNMPv2-TC.py
+++ b/pysnmp/smi/mibs/SNMPv2-TC.py
@@ -86,7 +86,7 @@ class TextualConvention:
return ''.join(outputValue)
else:
raise SmiError(
- 'Unsupported numeric type spec: %s' % displayHintType
+ 'Unsupported numeric type spec "%s" at %s' % (displayHintType, self.__class__.__name__)
)
elif self.displayHint and self.__octetString.isSuperTypeOf(self):
outputValue = ''
@@ -222,7 +222,7 @@ class TextualConvention:
raise SmiError(
'integer evaluation error: %s' % sys.exc_info()[1]
)
- elif displayHintType == 'd' and '.' in value:
+ elif displayHintType == 'd':
try:
return base.prettyIn(self, int(float(value) * 10**int(decimalPrecision)))
except Exception:
@@ -250,7 +250,7 @@ class TextualConvention:
return base.prettyIn(self, binValue)
else:
raise SmiError(
- 'Unsupported numeric type spec: %s' % displayHintType
+ 'Unsupported numeric type spec "%s" at %s' % (displayHintType, self.__class__.__name__)
)
elif self.displayHint and self.__octetString.isSuperTypeOf(self):