Browse Source

move _HxException to Haxe

Simon Krajewski 11 years ago
parent
commit
669b5744ca
3 changed files with 13 additions and 13 deletions
  1. 0 13
      genpy.ml
  2. 1 0
      std/python/Boot.hx
  3. 12 0
      std/python/internal/HxException.hx

+ 0 - 13
genpy.ml

@@ -15,19 +15,6 @@ _hx_c = _hx_AnonObject()
 _hx_c._hx_AnonObject = _hx_AnonObject
 
 import functools as _hx_functools
-
-class _HxException(Exception):
-    # String tag;
-    # int index;
-    # List params;
-    def __init__(self, val):
-        try:
-            message = _hx_c.Std.string(val)
-        except Exception:
-            message = '_HxException'
-        Exception.__init__(self, message)
-        self.val = val
-
 import math as _hx_math
 "
 

+ 1 - 0
std/python/Boot.hx

@@ -4,6 +4,7 @@ package python;
 import python.lib.Builtin;
 import python.internal.EnumImpl;
 import python.internal.HxOverrides;
+import python.internal.HxException;
 
 @:keep class Boot {
 

+ 12 - 0
std/python/internal/HxException.hx

@@ -0,0 +1,12 @@
+package python.internal;
+
+@:keep
+@:native("_HxException")
+class HxException extends python.lib.Types.Exception {
+	public var val:Dynamic;
+	public function new(val) {
+		var message = Std.string(val);
+		super(message);
+		this.val = val;
+	}
+}