Skip to content

Commit 25f444f

Browse files
committed
Adjust Scope creation for old Kraken scopes
1 parent 4fb2d61 commit 25f444f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

twitchio/authentication/scopes.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,16 @@ def __init__(self, scopes: Iterable[str | _scope_property] | None = None, /, **k
355355
if scope == "openid":
356356
continue
357357

358-
prop = getattr(self, scope.replace(":", "_"))
359-
elif isinstance(scope, _scope_property): # type: ignore
358+
attr_name = scope.replace(":", "_")
359+
360+
if not hasattr(self, attr_name):
361+
continue
362+
363+
prop = getattr(self, attr_name)
364+
365+
elif isinstance(scope, _scope_property): # type: ignore[unnecessary-isinstance]
360366
prop = scope
367+
361368
else:
362369
raise TypeError(f"Invalid scope provided: {type(scope)} is not a valid scope.")
363370

0 commit comments

Comments
 (0)