Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

js2c: raise proper Exception, not a string

Fixes the following error message:

  TypeError: exceptions must be old-style classes or derived
  from BaseException, not str

Fixes #4303.
  • Loading branch information...
commit aa3441ae45b348aa2e1b422d1c5a69b49e909a95 1 parent 335f208
@bnoordhuis bnoordhuis authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  tools/
2  tools/
@@ -206,7 +206,7 @@ def ReadMacros(lines):
fun = eval("lambda " + ",".join(args) + ': ' + body)
macros[name] = PythonMacro(args, fun)
- raise ("Illegal line: " + line)
+ raise Exception("Illegal line: " + line)
return (constants, macros)

2 comments on commit aa3441a


Thanks @bnoordhuis for the patch, please note that this bug and more like it are also in deps/v8/tools/, so these should probably be sent upstream, too.

$ git grep raise -- '**/'
deps/v8/tools/    raise ("Eval disallowed in natives: %s" % file)
deps/v8/tools/    raise ("With statements disallowed in natives: %s" % file)
deps/v8/tools/          raise ("Illegal line: " + line)
tools/          raise Exception("Illegal line: " + line)

@ackalker Those are in v8, and should be fixed on v8. Better create an issue v8 issue tracker.

Please sign in to comment.
Something went wrong with that request. Please try again.