瀏覽代碼

getchar returns bytes

frabbit 11 年之前
父節點
當前提交
7294c1a79c
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      std/python/_std/Sys.hx
  2. 1 1
      std/python/lib/Msvcrt.hx

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

@@ -92,7 +92,7 @@ class Sys {
 				}
 
 			case "win32" | "cygwin":
-				python.lib.Msvcrt.getch();
+				python.lib.Msvcrt.getch().decode("utf-8").charCodeAt(0);
 			case x :
 				throw "platform " + x + " not supported";
 		}

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

@@ -3,7 +3,7 @@ package python.lib;
 
 extern class Msvcrt {
 
-	public static function getch ():Int;
+	public static function getch ():python.lib.Types.Bytes;
 
 	static function __init__ ():Void
 	{