Skip to content

Commit 0c77fb7

Browse files
committed
typing fix
1 parent ff52f68 commit 0c77fb7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rich/_win32_console.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
44
"""
5+
56
import ctypes
67
import sys
78
from typing import Any
@@ -380,7 +381,7 @@ def cursor_position(self) -> WindowsCoordinates:
380381
WindowsCoordinates: The current cursor position.
381382
"""
382383
coord: COORD = GetConsoleScreenBufferInfo(self._handle).dwCursorPosition
383-
return WindowsCoordinates(row=cast(int, coord.Y), col=cast(int, coord.X))
384+
return WindowsCoordinates(row=coord.Y, col=coord.X)
384385

385386
@property
386387
def screen_size(self) -> WindowsCoordinates:
@@ -390,9 +391,7 @@ def screen_size(self) -> WindowsCoordinates:
390391
WindowsCoordinates: The width and height of the screen as WindowsCoordinates.
391392
"""
392393
screen_size: COORD = GetConsoleScreenBufferInfo(self._handle).dwSize
393-
return WindowsCoordinates(
394-
row=cast(int, screen_size.Y), col=cast(int, screen_size.X)
395-
)
394+
return WindowsCoordinates(row=screen_size.Y, col=screen_size.X)
396395

397396
def write_text(self, text: str) -> None:
398397
"""Write text directly to the terminal without any modification of styles

0 commit comments

Comments
 (0)