From 8794dd794eaa1e1fd9ee4677bbfff450f1c50021 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 30 Aug 2010 15:19:56 +0000 Subject: [PATCH] coff-dump.py: Fix PR7996. Now it is compatible to Python-2.4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112485 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Scripts/coff-dump.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py index 464ab3110b4..0af3d368d5d 100755 --- a/test/Scripts/coff-dump.py +++ b/test/Scripts/coff-dump.py @@ -397,8 +397,11 @@ def handle_enum(entry): selector = read_value (definitions [0]) definitions = definitions [1] [selector] - description = definitions[value] if value in definitions else "unknown" - + if value in definitions: + description = definitions[value] + else: + description = "unknown" + write ("%s (" % description) write_value (oformat, value) write (")")