Explorar o código

getchar returns bytes

frabbit %!s(int64=11) %!d(string=hai) anos
pai
achega
7294c1a79c
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  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
 	{