Skip to content

Commit

Permalink
Use Optional[str] for values that could be None
Browse files Browse the repository at this point in the history
  • Loading branch information
br3ndonland committed Sep 21, 2020
1 parent 00d336c commit 9c79964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inboard/app/utilities.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import base64
import os
from secrets import compare_digest
from typing import Tuple, Union
from typing import Optional, Tuple

from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBasic, HTTPBasicCredentials
Expand All @@ -17,7 +17,7 @@
class BasicAuth(AuthenticationBackend):
async def authenticate(
self, request: HTTPConnection
) -> Union[Tuple[AuthCredentials, SimpleUser], None]:
) -> Optional[Tuple[AuthCredentials, SimpleUser]]:
if "Authorization" not in request.headers:
return None

Expand Down
6 changes: 3 additions & 3 deletions inboard/gunicorn_conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import multiprocessing
import os
from typing import Union
from typing import Optional

from inboard.start import configure_logging


def calculate_workers(
max_workers_str: Union[str, None],
web_concurrency_str: Union[str, None],
max_workers_str: Optional[str],
web_concurrency_str: Optional[str],
workers_per_core_str: str,
cores: int = multiprocessing.cpu_count(),
) -> int:
Expand Down

0 comments on commit 9c79964

Please sign in to comment.