From 389ee1b30958542fcaa82769f5fb3e8e5ed4cc6e Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Thu, 6 Jan 2011 21:05:44 +0000 Subject: 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 --- tools/src/py/qpid-tool | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools') 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 -- cgit v1.2.1