Author: chug
Date: Thu Jan 6 21:05:44 2011
New Revision: 1056076
URL: http://svn.apache.org/viewvc?rev=1056076&view=rev
Log:
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'.
Modified:
qpid/trunk/qpid/tools/src/py/qpid-tool
Modified: qpid/trunk/qpid/tools/src/py/qpid-tool
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-tool?rev=1056076&r1=1056075&r2=1056076&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-tool (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-tool Thu Jan 6 21:05:44 2011
@@ -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
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]