Skip to content

Commit

Permalink
Bug Fix: Exceptions
Browse files Browse the repository at this point in the history
The builtin exceptions were not available for users the throw in their Python code.  export them in builtindict.js
  • Loading branch information
bnmnetp committed Feb 18, 2013
1 parent d908047 commit c3c8d70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/builtindict.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Sk.builtins = {

'AttributeError': Sk.builtin.AttributeError,
'ValueError': Sk.builtin.ValueError,
'Exception' : Sk.builtin.Exception,
'ZeroDivisionError' : Sk.builtin.ZeroDivisionError,
'AssertionError' : Sk.builtin.AssertionError,
'ImportError' : Sk.builtin.ImportError,
'IndentationError' : Sk.builtin.IndentationError,
'IndexError' : Sk.builtin.IndexError,
'KeyError' : Sk.builtin.KeyError,
'TypeError' : Sk.builtin.TypeError,
'NameError' : Sk.builtin.NameError,
'IOError' : Sk.builtin.IOError,
'NotImplementedError' : Sk.builtin.NotImplementedError,

'dict': Sk.builtin.dict,
'file': Sk.builtin.file,
Expand Down
2 changes: 2 additions & 0 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Sk.builtin.Exception.prototype.toString = function()
return this.tp$str().v;
}

goog.exportSymbol("Sk.builtin.Exception", Sk.builtin.Exception);

/**
* @constructor
* @extends Sk.builtin.Exception
Expand Down

0 comments on commit c3c8d70

Please sign in to comment.