No need for pytz

This commit is contained in:
Edward Betts 2023-12-23 10:05:24 +00:00
parent e29c5899aa
commit 7dd9881943

View file

@ -7,10 +7,8 @@ import json
import os import os
import sys import sys
import typing import typing
from collections import Counter from datetime import datetime, timezone
from datetime import date, datetime, timedelta
import pytz
import requests import requests
config = configparser.ConfigParser() config = configparser.ConfigParser()
@ -70,7 +68,7 @@ def parse_date(date_str: str | None) -> datetime | None:
return None return None
fmt = "%Y-%m-%dT%H:%M:%SZ" if date_str.endswith("Z") else "%Y-%m-%dT%H:%M:%S%z" fmt = "%Y-%m-%dT%H:%M:%SZ" if date_str.endswith("Z") else "%Y-%m-%dT%H:%M:%S%z"
return datetime.strptime(date_str, fmt).astimezone(pytz.utc) return datetime.strptime(date_str, fmt).astimezone(timezone.utc)
def count_open_bugs(bug_reports: list[Bug]) -> list[tuple[str, int]]: def count_open_bugs(bug_reports: list[Bug]) -> list[tuple[str, int]]: