Skip to content

Commit 54e69b7

Browse files
committed
run pyupgrade --py38-plus
1 parent b4fdb17 commit 54e69b7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

trio/_channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _open_memory_channel(
9999
if TYPE_CHECKING:
100100
# written as a class so you can say open_memory_channel[int](5)
101101
# Need to use Tuple instead of tuple due to CI check running on 3.8
102-
class open_memory_channel(Tuple[MemorySendChannel[T], MemoryReceiveChannel[T]]):
102+
class open_memory_channel(tuple[MemorySendChannel[T], MemoryReceiveChannel[T]]):
103103
def __new__( # type: ignore[misc] # "must return a subtype"
104104
cls, max_buffer_size: int
105105
) -> tuple[MemorySendChannel[T], MemoryReceiveChannel[T]]:
@@ -218,7 +218,7 @@ def abort_fn(_: RaiseCancelT) -> Abort:
218218

219219
# Return type must be stringified or use a TypeVar
220220
@enable_ki_protection
221-
def clone(self) -> "MemorySendChannel[SendType]":
221+
def clone(self) -> MemorySendChannel[SendType]:
222222
"""Clone this send channel object.
223223
224224
This returns a new `MemorySendChannel` object, which acts as a
@@ -361,7 +361,7 @@ def abort_fn(_: RaiseCancelT) -> Abort:
361361
return await trio.lowlevel.wait_task_rescheduled(abort_fn) # type: ignore[no-any-return]
362362

363363
@enable_ki_protection
364-
def clone(self) -> "MemoryReceiveChannel[ReceiveType]":
364+
def clone(self) -> MemoryReceiveChannel[ReceiveType]:
365365
"""Clone this receive channel object.
366366
367367
This returns a new `MemoryReceiveChannel` object, which acts as a

trio/_core/_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
if TYPE_CHECKING:
4848
# An unfortunate name collision here with trio._util.Final
49-
from typing_extensions import Final as FinalT
49+
from typing import Final as FinalT
5050

5151
DEADLINE_HEAP_MIN_PRUNE_THRESHOLD: FinalT = 1000
5252

@@ -1312,7 +1312,7 @@ def raise_cancel():
13121312

13131313

13141314
class RunContext(threading.local):
1315-
runner: "Runner"
1315+
runner: Runner
13161316
task: Task
13171317

13181318

trio/_tests/test_exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def no_hidden(symbols):
263263
cache_json = json.loads(cache_file.read())
264264

265265
# skip a bunch of file-system activity (probably can un-memoize?)
266-
@functools.lru_cache()
266+
@functools.lru_cache
267267
def lookup_symbol(symbol):
268268
topname, *modname, name = symbol.split(".")
269269
version = next(cache.glob("3.*/"))

trio/_unix_pipes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import trio
1111

1212
if TYPE_CHECKING:
13-
from typing_extensions import Final as FinalType
13+
from typing import Final as FinalType
1414

1515
if os.name != "posix":
1616
# We raise an error here rather than gating the import in lowlevel.py

0 commit comments

Comments
 (0)