diff options
| author | Charles E. Rolke <chug@apache.org> | 2011-01-06 21:05:44 +0000 |
|---|---|---|
| committer | Charles E. Rolke <chug@apache.org> | 2011-01-06 21:05:44 +0000 |
| commit | 389ee1b30958542fcaa82769f5fb3e8e5ed4cc6e (patch) | |
| tree | a9e0b896fea1410944c48bf5e18d146fccc1b30d | |
| parent | cec2c3ccef4a265608e8897d1ebc47aaa4d0caa9 (diff) | |
| download | qpid-python-389ee1b30958542fcaa82769f5fb3e8e5ed4cc6e.tar.gz | |
qpid-tool throws
TypeError(unsupported operand types for /: 'NoneType' and 'int',")
when it shows a session.expireTime object with a missing value.
Some values are optional and are normally missing.
This patch prevents the exception and displays 'absent'.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1056076 13f79535-47bb-0310-9956-ffa450edef68
| -rwxr-xr-x | tools/src/py/qpid-tool | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/src/py/qpid-tool b/tools/src/py/qpid-tool index e7c0231b96..d3b0aa4097 100755 --- a/tools/src/py/qpid-tool +++ b/tools/src/py/qpid-tool @@ -23,6 +23,7 @@ import os import optparse import sys import socket +from types import * from cmd import Cmd from shlex import split from threading import Lock @@ -484,6 +485,8 @@ class QmfData(Console): raise ValueError ("Invalid type code: %s" % str(typecode)) def valueByType(self, typecode, val): + if type(val) is type(None): + return "absent" if typecode == 1: return "%d" % val elif typecode == 2: return "%d" % val elif typecode == 3: return "%d" % val |
