Raise Exceptions containing a string instead of string exceptions
authorBalint Reczey <balint.reczey@ericsson.com>
Thu, 23 Dec 2010 23:36:48 +0000 (23:36 -0000)
committerBalint Reczey <balint.reczey@ericsson.com>
Thu, 23 Dec 2010 23:36:48 +0000 (23:36 -0000)
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4846

svn path=/trunk/; revision=35258

tools/asn2wrs.py

index 7302d784501e7f0b1898ea2bbb9dd6aa9ed2e514..783dbf48a6bfe0671ddf1538d60b75c8d3e74873 100755 (executable)
@@ -443,7 +443,7 @@ class Ctx:
         if ident in self.assignments:
             raise DuplicateError("assignment", ident)
         if ident in self.defined_dict:
-            raise "cross-module duplicates for " + ident
+            raise Exception("cross-module duplicates for %s" % ident)
         self.defined_dict [ident] = 1
         self.assignments[ident] = val
         self.dependencies [ident] = dependencies
@@ -843,7 +843,7 @@ class EthCtx:
   def dummy_import_type(self, ident):
     # dummy imported
     if ident in self.type:
-        raise "Try to dummy import for existing type :" + ident
+        raise Exception("Try to dummy import for existing type :%s" % ident)
     ethtype = asn2c(ident)
     self.type[ident] = {'import'  : 'xxx', 'proto' : 'xxx',
                         'ethname' : ethtype }