Skip to content

Commit a68ff14

Browse files
committed
Fix typing
1 parent 67f7c6b commit a68ff14

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

github/DependabotAlert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _useAttributes(self, attributes: dict[str, Any]) -> None:
154154
attributes["dismissed_by"],
155155
(github.NamedUser.NamedUser, "User"),
156156
(github.Organization.Organization, "Organization"),
157-
)
157+
) # type: ignore
158158
if "dismissed_comment" in attributes:
159159
self._dismissed_comment = self._makeStringAttribute(attributes["dismissed_comment"])
160160
if "dismissed_reason" in attributes:

github/GithubObject.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
K = typing.TypeVar("K")
7373
T_co = typing.TypeVar("T_co", covariant=True)
7474
T_gh = typing.TypeVar("T_gh", bound="GithubObject")
75-
T_gh2 = typing.TypeVar("T_gh2", bound="GithubObject")
7675

7776

7877
class Attribute(Protocol[T_co]):
@@ -371,8 +370,8 @@ def _makeClassAttribute(self, klass: type[T_gh], value: Any) -> Attribute[T_gh]:
371370
)
372371

373372
def _makeUnionClassAttributeFromTypeName(
374-
self, type_name: str | None, value: Any, *class_and_names: (type[T_gh], str)
375-
) -> Attribute[T_gh | T_gh2]:
373+
self, type_name: str | None, value: Any, *class_and_names: tuple[type[T_gh], str]
374+
) -> Attribute[T_gh]:
376375
if value is None or type_name is None:
377376
return _ValuedAttribute(None) # type: ignore
378377
for klass, name in class_and_names:
@@ -385,8 +384,8 @@ def _makeUnionClassAttributeFromTypeKey(
385384
type_key: str,
386385
default_type: str | None,
387386
value: Any,
388-
*class_and_names: (type[T_gh], str),
389-
) -> Attribute[T_gh | T_gh2]:
387+
*class_and_names: tuple[type[T_gh], str],
388+
) -> Attribute[T_gh]:
390389
if value is None or not isinstance(value, dict):
391390
return _ValuedAttribute(None) # type: ignore
392391
return self._makeUnionClassAttributeFromTypeName(value.get(type_key, default_type), value, *class_and_names)
@@ -397,8 +396,8 @@ def _makeUnionClassAttributeFromTypeKeyAndValueKey(
397396
value_key: str,
398397
default_type: str | None,
399398
value: Any,
400-
*class_and_names: (type[T_gh], str),
401-
) -> Attribute[T_gh | T_gh2]:
399+
*class_and_names: tuple[type[T_gh], str],
400+
) -> Attribute[T_gh]:
402401
if value is None or not isinstance(value, dict):
403402
return _ValuedAttribute(None) # type: ignore
404403
return self._makeUnionClassAttributeFromTypeName(

0 commit comments

Comments
 (0)