Skip to content

Commit 64cfb8d

Browse files
committed
Fix reference to undefined value typing.T
1 parent a5fd819 commit 64cfb8d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: ipfshttpclient/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
else:
1313
ty_ext = ty
1414

15+
T = ty.TypeVar("T")
16+
1517
if sys.version_info >= (3, 8): #PY38+
1618
Literal = ty_ext.Literal
1719
Protocol = ty_ext.Protocol
1820

1921
Literal_True = ty.Literal[True]
2022
Literal_False = ty.Literal[False]
2123
else: #PY37-
22-
class Literal(ty.Generic[ty.T]):
24+
class Literal(ty.Generic[T]):
2325
...
2426

2527
class Protocol:
@@ -240,4 +242,4 @@ def wrapper(*args: ty.Any, **kwargs: ty.Any) -> T:
240242
"""
241243
res = cmd(*args, **kwargs) # type: ty.Dict[str, T]
242244
return res[self.field]
243-
return wrapper
245+
return wrapper

0 commit comments

Comments
 (0)