Raise Exceptions containing a string instead of string exceptions

This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4846

svn path=/trunk/; revision=35258
This commit is contained in:
Balint Reczey 2010-12-23 23:36:48 +00:00
parent 158e9a3dae
commit 04386e3ca1
1 changed files with 2 additions and 2 deletions

View File

@ -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 }