Skip to content

Commit 5774e51

Browse files
committed
Use import alias for typing module
1 parent 25d68f3 commit 5774e51

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

libtmux/_compat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# flake8: NOQA
22
import sys
3+
import typing as t
34
from collections.abc import MutableMapping
4-
from typing import Union
55

66
console_encoding = sys.__stdout__.encoding
77

@@ -21,7 +21,7 @@ def reraise(tp, value, tb=None):
2121
raise value
2222

2323

24-
def str_from_console(s: Union[str, bytes]) -> str:
24+
def str_from_console(s: t.Union[str, bytes]) -> str:
2525
try:
2626
return str(s)
2727
except UnicodeDecodeError:

libtmux/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import re
1111
import subprocess
1212
import sys
13+
import typing as t
1314
from distutils.version import LooseVersion
14-
from typing import Optional
1515

1616
from . import exc
1717
from ._compat import MutableMapping, console_to_str, str_from_console
@@ -376,15 +376,15 @@ def get_by_id(self, id):
376376

377377
def which(
378378
exe: str,
379-
default_paths: list[str] = [
379+
default_paths: t.List[str] = [
380380
"/bin",
381381
"/sbin",
382382
"/usr/bin",
383383
"/usr/sbin",
384384
"/usr/local/bin",
385385
],
386386
append_env_path: bool = True,
387-
) -> Optional[str]:
387+
) -> t.Optional[str]:
388388
"""
389389
Return path of bin. Python clone of /usr/bin/which.
390390

0 commit comments

Comments
 (0)