qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1056076 - /qpid/trunk/qpid/tools/src/py/qpid-tool
Date Thu, 06 Jan 2011 21:05:44 GMT
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:commits-subscribe@qpid.apache.org


Mime
View raw message