Skip to contentSkip to conversation

Fix TypeError handling of xentrace_format

PATCH New Yosuke Iwamatsu 1 participant 1 message Nov 13, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix TypeError handling of xentrace_format

Hi,

Attached patch fixes TypeError handling of xentrace_format.

Regards,
-------------------
Yosuke Iwamatsu
NEC Corporation

# HG changeset patch
# User Yosuke Iwamatsu <[email protected]> # Date 1194919149 -32400
# Node ID 2770b04195ea24e6918dc59ae7943483485b4401 # Parent 837f83225153547109480d63b3386cb8f65b5274 Fix TypeError handling of xentrace_format.

tools/xentrace/xentrace_format +8 -3
diff -r 837f83225153 -r 2770b04195ea tools/xentrace/xentrace_format
@@ -198,10 +198,15 @@ while not interrupted:
             if defs.has_key(str(event)): 
                 print defs[str(event)] % args
             else:
-               if defs.has_key(str(0)): print defs[str(0)] % args
+                if defs.has_key(str(0)): print defs[str(0)] % args
         except TypeError:
-            print defs[str(event)]
-            print args
+            if defs.has_key(str(event)):
+                print defs[str(event)]
+                print args
+            else:
+                if defs.has_key(str(0)):
+                    print defs[str(0)]
+                    print args
 
 
     except IOError, struct.error: sys.exit()

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel