Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix backports.zoneinfo import for Python<3.9 #80

Merged
merged 9 commits into from
Aug 24, 2023
Merged
6 changes: 5 additions & 1 deletion flow/record/fieldtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
from posixpath import basename, dirname
from typing import Any, Optional, Tuple
from urllib.parse import urlparse
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError

try:
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
except ImportError:
from backports.zoneinfo import ZoneInfo, ZoneInfoNotFoundError

Check warning on line 20 in flow/record/fieldtypes/__init__.py

View check run for this annotation

Codecov / codecov/patch

flow/record/fieldtypes/__init__.py#L19-L20

Added lines #L19 - L20 were not covered by tests

from flow.record.base import FieldType

Expand Down