Skip to content

Commit 491b5e8

Browse files
Typing fix in FileHistory.
1 parent 3c0290d commit 491b5e8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/prompt_toolkit/history.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import threading
1616
from abc import ABCMeta, abstractmethod
1717
from asyncio import get_running_loop
18-
from typing import AsyncGenerator, Iterable, Sequence
18+
from typing import AsyncGenerator, Iterable, Sequence, Union
1919

2020
__all__ = [
2121
"History",
@@ -255,12 +255,15 @@ def append_string(self, string: str) -> None:
255255
pass
256256

257257

258+
_StrOrBytesPath = Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]
259+
260+
258261
class FileHistory(History):
259262
"""
260263
:class:`.History` class that stores all strings in a file.
261264
"""
262265

263-
def __init__(self, filename: str | os.PathLike) -> None:
266+
def __init__(self, filename: _StrOrBytesPath) -> None:
264267
self.filename = filename
265268
super().__init__()
266269

0 commit comments

Comments
 (0)