helpers: aportupgrade: fix req_headers init (MR 2252)

I broke this while adding type hints.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-13 02:07:30 +02:00 committed by Oliver Smith
parent 0970b9d00b
commit 42d9f4e3cd
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -13,8 +13,8 @@ import pmb.helpers.file
import pmb.helpers.http
import pmb.helpers.pmaports
req_headers: Dict[str, str]
req_headers_github: Dict[str, str]
req_headers: Dict[str, str] = {}
req_headers_github: Dict[str, str] = {}
ANITYA_API_BASE = "https://release-monitoring.org/api/v2"
GITHUB_API_BASE = "https://api.github.com"
@ -31,7 +31,7 @@ def init_req_headers() -> None:
global req_headers
global req_headers_github
# Only initialize them once
if req_headers is not None and req_headers_github is not None:
if req_headers and req_headers_github:
return
# Generic request headers
req_headers = {