Clarify error message
@@ -45,8 +45,8 @@ class VarBind(namedtuple('VarBind', 'oid, value')):
def __new__(cls, oid, value):
if not isinstance(oid, (ObjectIdentifier,) + six.string_types):
- raise TypeError('OIDs for VarBinds must be ObjectIdentifier or str'
- ' instances!')
+ raise TypeError('%r is neither an ObjectIdentifier or str '
+ 'instance!' % oid)
if isinstance(oid, six.string_types):
oid = ObjectIdentifier.from_string(oid)
return super(VarBind, cls).__new__(cls, oid, value)
