@@ -118,14 +118,24 @@ def __init__(
118118 self .client_id = client_id
119119 self .client_secret = client_secret
120120
121- self .scopes = scopes or os .environ .get ("SLACK_SCOPES" , "" ).split ("," )
121+ # NOTE: pytype says that self.scopes can be str, not Sequence[str].
122+ # That's true but we will check the pattern in the following if statement.
123+ # Thus, we ignore the warnings here. This is the same for user_scopes too.
124+ self .scopes = ( # type: ignore
125+ scopes # type: ignore
126+ if scopes is not None
127+ else os .environ .get ("SLACK_SCOPES" , "" ).split ("," ) # type: ignore
128+ ) # type: ignore
122129 if isinstance (self .scopes , str ):
123130 self .scopes = self .scopes .split ("," )
124- self .user_scopes = user_scopes or os .environ .get ("SLACK_USER_SCOPES" , "" ).split (
125- ","
126- )
131+ self .user_scopes = ( # type: ignore
132+ user_scopes
133+ if user_scopes is not None
134+ else os .environ .get ("SLACK_USER_SCOPES" , "" ).split ("," ) # type: ignore
135+ ) # type: ignore
127136 if isinstance (self .user_scopes , str ):
128137 self .user_scopes = self .user_scopes .split ("," )
138+
129139 self .redirect_uri = redirect_uri or os .environ .get ("SLACK_REDIRECT_URI" )
130140 # Handler configuration
131141 self .install_path = install_path or os .environ .get (
0 commit comments