Skip to content

Commit 74edfc2

Browse files
committed
Fixed linting with updated pyright
1 parent 23694d9 commit 74edfc2

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/AutoSplit.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
import os
1313
import signal
1414
import sys
15-
import traceback
1615
from collections.abc import Callable
1716
from time import time
18-
from types import FunctionType, TracebackType
17+
from types import FunctionType
1918
from typing import Optional
2019

2120
import certifi
@@ -735,7 +734,9 @@ def __get_capture_for_comparison(self):
735734
# This most likely means we lost capture (ie the captured window was closed, crashed, etc.)
736735
# We can't recover by name (yet) with WindowsGraphicsCapture
737736
if (
738-
capture is None or not capture.size) and self.settings_dict["capture_method"] != CaptureMethod.WINDOWS_GRAPHICS_CAPTURE:
737+
(capture is None or not capture.size)
738+
and self.settings_dict["capture_method"] != CaptureMethod.WINDOWS_GRAPHICS_CAPTURE
739+
):
739740
# Try to recover by using the window name
740741
self.live_image.setText("Trying to recover window...")
741742
hwnd = win32gui.FindWindow(None, self.settings_dict["captured_window_title"])

src/capture_windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __windows_graphics_capture(windows_graphics_capture: Optional[WindowsGraphic
102102
return windows_graphics_capture.last_captured_frame, True
103103

104104
async def coroutine():
105-
async_operation = SoftwareBitmap.create_copy_from_surface_async(frame.surface) # pyright: ignore
105+
async_operation = SoftwareBitmap.create_copy_from_surface_async(frame.surface)
106106
return await async_operation if async_operation else None
107107
try:
108108
software_bitmap = asyncio.run(coroutine())

src/screen_region.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,11 @@ def callback(async_operation: IAsyncOperation[GraphicsCaptureItem], async_status
126126
session.is_cursor_capture_enabled = False
127127
# TODO: Consider GraphicsCaptureSession.IsBorderRequired = False
128128
session.start_capture()
129-
autosplit.windows_graphics_capture = WindowsGraphicsCapture(
130-
item.size, frame_pool, session, None) # pyright: ignore
129+
autosplit.windows_graphics_capture = WindowsGraphicsCapture(item.size, frame_pool, session, None)
131130

132131
picker = GraphicsCapturePicker()
133132
initialize_with_window(picker, autosplit.effectiveWinId().__int__())
134-
async_operation = picker.pick_single_item_async() # pyright: ignore
133+
async_operation = picker.pick_single_item_async()
135134
# None if the selection is canceled
136135
if async_operation:
137136
async_operation.completed = callback

typings/PyInstaller/utils/hooks/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def collect_dynamic_libs(package: str, destdir: Optional[str] = ...) -> list[tup
9191
...
9292

9393

94-
def collect_data_files(package, include_py_files=..., subdir=..., excludes=..., includes=...) -> list[tuple[str, str]]:
94+
def collect_data_files(package: str, include_py_files: bool = ..., subdir: str = ...,
95+
excludes: list[str] = ..., includes: list[str] = ...) -> list[tuple[str, str]]:
9596
...
9697

9798

0 commit comments

Comments
 (0)