Browse Source

[python] move python.lib.Exceptions to python.Exceptions, change BaseException constructor args to haxe.Rest

Dan Korostelev 10 years ago
parent
commit
3a302fa1ec

+ 5 - 5
std/python/lib/Exceptions.hx → std/python/Exceptions.hx

@@ -1,5 +1,5 @@
 /*
- * Copyright (C)2005-2012 Haxe Foundation
+ * Copyright (C)2005-2015 Haxe Foundation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -19,13 +19,13 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-package python.lib;
+package python;
 
 
 @:native("BaseException")
 extern class BaseException
 {
-	public function new (msg:String):Void;
+	function new(args:haxe.Rest<Dynamic>):Void;
 }
 
 
@@ -63,7 +63,7 @@ extern class SyntaxError extends Exception
 @:native("StopIteration")
 extern class StopIteration extends Exception
 {
-	public function new (?message:String);
+
 }
 
 @:native("RuntimeError")
@@ -372,4 +372,4 @@ extern class BytesWarning extends Warning
 extern class ResourceWarning extends Warning
 {
 
-}
+}

+ 1 - 1
std/python/HaxeIterator.hx

@@ -21,7 +21,7 @@
  */
 package python;
 
-import python.lib.Exceptions.StopIteration;
+import python.Exceptions.StopIteration;
 import python.NativeIterator;
 
 class HaxeIterator<T> {

+ 1 - 1
std/python/Lib.hx

@@ -95,7 +95,7 @@ class Lib {
 					if (it1.hasNext()) {
 						return it1.next();
 					} else {
-						throw new python.lib.Exceptions.StopIteration();
+						throw new python.Exceptions.StopIteration();
 					}
 				},
 				__iter__ : function () return self

+ 1 - 1
std/python/_std/sys/net/Socket.hx

@@ -24,7 +24,7 @@ package sys.net;
 import haxe.io.Error;
 import haxe.io.Bytes;
 import haxe.io.BytesData;
-import python.lib.Exceptions;
+import python.Exceptions;
 import python.Tuple;
 import python.lib.net.Socket in PSocket;
 import python.lib.net.Socket.Select in Select;

+ 1 - 1
std/python/internal/HxException.hx

@@ -23,7 +23,7 @@ package python.internal;
 
 @:ifFeature("has_throw")
 @:native("_HxException")
-class HxException extends python.lib.Exceptions.Exception {
+class HxException extends python.Exceptions.Exception {
 	@:ifFeature("has_throw")
 	public var val:Dynamic;
 	@:ifFeature("has_throw")

+ 1 - 1
std/python/lib/Os.hx

@@ -22,7 +22,7 @@
 package python.lib;
 
 
-import python.lib.Exceptions.OSError;
+import python.Exceptions.OSError;
 import python.Tuple;
 import python.Dict;
 

+ 1 - 1
std/python/lib/Shutil.hx

@@ -25,7 +25,7 @@ package python.lib;
 @:pythonImport("shutil")
 extern class Shutil {
 
-	public static function rmtree(path:String, ?ignore_errors:Bool=false, ?onerror:python.lib.Exceptions.BaseException->Void):Void;
+	public static function rmtree(path:String, ?ignore_errors:Bool=false, ?onerror:python.Exceptions.BaseException->Void):Void;
 
 	public static function copyfile (src:String, dst:String):Void;
 

+ 1 - 1
std/python/lib/Sys.hx

@@ -21,7 +21,7 @@
  */
 package python.lib;
 
-import python.lib.Exceptions.BaseException;
+import python.Exceptions.BaseException;
 import python.lib.io.FileIO;
 import python.lib.io.RawIOBase;
 import python.lib.io.TextIOBase;

+ 1 - 1
std/python/lib/io/BlockingIOError.hx

@@ -21,7 +21,7 @@
  */
 package python.lib.io;
 
-import python.lib.Exceptions.IOError;
+import python.Exceptions.IOError;
 
 @:pythonImport("io", "BlockingIOError")
 class BlockingIOError extends IOError {

+ 1 - 1
std/python/lib/io/UnsupportedOperation.hx

@@ -21,7 +21,7 @@
  */
 package python.lib.io;
 
-import python.lib.Exceptions.IOError;
+import python.Exceptions.IOError;
 
 @:pythonImport("io", "UnsupportedOperation")
 class UnsupportedOperation extends IOError {