Skip to content

Commit 7a49bfe

Browse files
committed
Use typing_extensions for ParamSpec (3.8 compat)
1 parent c11ddae commit 7a49bfe

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

jishaku/exception_handling.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import discord
2121
from discord.ext import commands
22+
from typing_extensions import ParamSpec
2223

2324
from jishaku.flags import Flags
2425

@@ -58,7 +59,7 @@ async def send_traceback(
5859

5960

6061
T = typing.TypeVar('T')
61-
P = typing.ParamSpec('P')
62+
P = ParamSpec('P')
6263

6364

6465
async def do_after_sleep(delay: float, coro: typing.Callable[P, typing.Awaitable[T]], *args: P.args, **kwargs: P.kwargs) -> T:

jishaku/features/baseclass.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from datetime import datetime, timezone
1919

2020
from discord.ext import commands
21+
from typing_extensions import ParamSpec
2122

2223
from jishaku.types import BotT, ContextA
2324

@@ -47,7 +48,7 @@
4748
]
4849

4950
T = typing.TypeVar('T')
50-
P = typing.ParamSpec('P')
51+
P = ParamSpec('P')
5152
Concatenate = typing.Concatenate
5253
Task = asyncio.Task[typing.Any]
5354
GenericFeature = typing.TypeVar('GenericFeature', bound='Feature')

jishaku/functools.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
import functools
1616
import typing
1717

18+
from typing_extensions import ParamSpec
19+
1820
T = typing.TypeVar('T')
19-
P = typing.ParamSpec('P')
21+
P = ParamSpec('P')
2022

2123

2224
def executor_function(sync_function: typing.Callable[P, T]) -> typing.Callable[P, typing.Awaitable[T]]:

jishaku/repl/inspections.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import os
1818
import typing
1919

20+
from typing_extensions import ParamSpec
21+
2022
INSPECTIONS: typing.List[
2123
typing.Tuple[
2224
str,
@@ -28,7 +30,7 @@
2830

2931

3032
T = typing.TypeVar('T')
31-
P = typing.ParamSpec('P')
33+
P = ParamSpec('P')
3234

3335

3436
def add_inspection(name: str) -> typing.Callable[

jishaku/shell.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
import time
2121
import typing
2222

23+
from typing_extensions import ParamSpec
24+
2325
T = typing.TypeVar('T')
24-
P = typing.ParamSpec('P')
26+
P = ParamSpec('P')
2527

2628

2729
SHELL = os.getenv("SHELL") or "/bin/bash"

requirements/_.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
braceexpand >= 0.1.7
22
click >= 8.1.7
33
discord.py >= 2.3.2
4-
import_expression >= 1.1.4, <2.0.0
4+
import_expression >= 1.1.4, < 2.0.0
55
tabulate >= 0.9.0
6+
typing-extensions >= 4.3, < 5

0 commit comments

Comments
 (0)