summaryrefslogtreecommitdiff
path: root/qpid/tools/src
diff options
context:
space:
mode:
authorCharles E. Rolke <chug@apache.org>2011-01-06 21:05:44 +0000
committerCharles E. Rolke <chug@apache.org>2011-01-06 21:05:44 +0000
commit54d3e2f9165a7fa8450db6c951ba78b0b5af7383 (patch)
tree0c1a074d8d12816d5dac660fa530b2d5560497d5 /qpid/tools/src
parent5107153dfe5dbba791b100fcf10f28363311443b (diff)
downloadqpid-python-54d3e2f9165a7fa8450db6c951ba78b0b5af7383.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@1056076 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tools/src')
-rwxr-xr-xqpid/tools/src/py/qpid-tool3
1 files changed, 3 insertions, 0 deletions
diff --git a/qpid/tools/src/py/qpid-tool b/qpid/tools/src/py/qpid-tool
index e7c0231b96..d3b0aa4097 100755
--- a/qpid/tools/src/py/qpid-tool
+++ b/qpid/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