Skip to content

Commit d7160ca

Browse files
authored
Pyinstaller: use StrPath over StrOrBytesPath (#8780)
Fix incorrect StrOrBytesPath in PyInstaller stubs Change StrOrBytesPath to StrPath when exclusively used with strings.
1 parent 6ca80d3 commit d7160ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stubs/pyinstaller/PyInstaller/building/build_main.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Referenced in: https://pyinstaller.org/en/stable/hooks.html?highlight=get_hook_config#PyInstaller.utils.hooks.get_hook_config
22
# Not to be imported during runtime, but is the type reference for hooks and analysis configuration
33

4-
from _typeshed import StrOrBytesPath
4+
from _typeshed import StrPath
55
from collections.abc import Iterable
66
from typing import Any
77

@@ -12,7 +12,7 @@ class Analysis(Target):
1212
hooksconfig: dict[str, dict[str, object]]
1313
def __init__(
1414
self,
15-
scripts: Iterable[StrOrBytesPath],
15+
scripts: Iterable[StrPath],
1616
pathex=...,
1717
binaries=...,
1818
datas=...,

stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://pyinstaller.org/en/stable/hooks.html
22

3-
from _typeshed import StrOrBytesPath, SupportsKeysAndGetItem
3+
from _typeshed import StrOrBytesPath, StrPath, SupportsKeysAndGetItem
44
from collections.abc import Callable, Iterable, Mapping
55
from typing import Any
66
from typing_extensions import Literal, TypeAlias
@@ -50,12 +50,12 @@ def collect_dynamic_libs(package: str, destdir: object = ...) -> list[tuple[str,
5050
def collect_data_files(
5151
package: str,
5252
include_py_files: bool = ...,
53-
subdir: StrOrBytesPath | None = ...,
53+
subdir: StrPath | None = ...,
5454
excludes: Iterable[str] | None = ...,
5555
includes: Iterable[str] | None = ...,
5656
) -> list[tuple[str, str]]: ...
5757
def collect_system_data_files(
58-
path: str, destdir: StrOrBytesPath | None = ..., include_py_files: bool = ...
58+
path: str, destdir: StrPath | None = ..., include_py_files: bool = ...
5959
) -> list[tuple[str, str]]: ...
6060
def copy_metadata(package_name: str, recursive: bool = ...) -> list[tuple[str, str]]: ...
6161
def get_installer(module: str) -> str | None: ...

0 commit comments

Comments
 (0)