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
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ deps =
extras = test
commands =
# Capturing output will fail on pypy, possibly due to this issue: https://github.com/pytest-dev/pytest/issues/5502
pytest --basetemp="{envtmpdir}" {posargs:--color=yes --capture=no --cov=flow --cov-report=term-missing -v tests}
pytest {posargs:--color=yes --capture=no --cov=flow --cov-report=term-missing -v tests}
coverage report
coverage xml

Expand Down