diff options
author | elie <elie> | 2006-08-09 20:18:13 +0000 |
---|---|---|
committer | elie <elie> | 2006-08-09 20:18:13 +0000 |
commit | 70248a52df182f9b606a17f73e59c8fd2870ea57 (patch) | |
tree | ab48898049546fb863a0594bccc7ea23dfb8fd4c /pysnmp/proto/rfc1902.py | |
parent | 8d13952a0de22467fc5626e785ec57dae6a7af8f (diff) | |
download | pysnmp-git-70248a52df182f9b606a17f73e59c8fd2870ea57.tar.gz |
fix to Bits pretty formatter/printer (SF bug #1537592)
Diffstat (limited to 'pysnmp/proto/rfc1902.py')
-rw-r--r-- | pysnmp/proto/rfc1902.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pysnmp/proto/rfc1902.py b/pysnmp/proto/rfc1902.py index a9d45e03..8e5dd867 100644 --- a/pysnmp/proto/rfc1902.py +++ b/pysnmp/proto/rfc1902.py @@ -86,8 +86,8 @@ class Bits(univ.OctetString): ) def prettyIn(self, bits): - if type(bits) == types.StringType: - return bits # raw bitstring + if type(bits) not in (types.TupleType, types.ListType): + return str(bits) # raw bitstring octets = [] for bit in bits: # tuple of named bits v = self.__namedValues.getValue(bit) @@ -103,7 +103,7 @@ class Bits(univ.OctetString): def prettyOut(self, value): names = [] - octets = tuple(map(None, value)) + octets = tuple(map(None, str(value))) i = 0 while i < len(octets): v = ord(octets[i]) |