Skip to content

Commit 2cad9dc

Browse files
c0llab0rat0rntninja
authored andcommitted
Fix reference to undefined value typing.T
1 parent cda19c7 commit 2cad9dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: ipfshttpclient/utils.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
else:
1212
ty_ext = ty
1313

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

1820
Literal_True = ty.Literal[True]
1921
Literal_False = ty.Literal[False]
2022
else: #PY37-
21-
class Literal(ty.Generic[ty.T]):
23+
class Literal(ty.Generic[T]):
2224
...
2325

2426
class Protocol:
@@ -172,7 +174,6 @@ def clean_files(files: ty.Union[clean_file_t, ty.Iterable[clean_file_t]]) \
172174
yield clean_file(ty.cast(clean_file_t, files))
173175

174176

175-
T = ty.TypeVar("T")
176177
F = ty.TypeVar("F", bound=ty.Callable[..., ty.Dict[str, ty.Any]])
177178

178179

@@ -211,4 +212,4 @@ def wrapper(*args: ty.Any, **kwargs: ty.Any) -> T:
211212
"""
212213
res = cmd(*args, **kwargs) # type: ty.Dict[str, T]
213214
return res[self.field]
214-
return wrapper
215+
return wrapper

0 commit comments

Comments
 (0)