Skip to content

Commit

Permalink
Reformat code; add backports.zoneinfo for Python version < 3.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao committed Apr 20, 2024
1 parent 0dfdd1a commit 172a9e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description = "Logging/encoding/decoding using CLP's IR stream format"
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"backports.zoneinfo >= 0.2.1; python_version<'3.9'",
"clp-ffi-py >= 0.0.9",
"typing-extensions >= 3.7.4",
"tzlocal >= 5.2",
Expand Down
1 change: 0 additions & 1 deletion src/clp_logging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import time
from abc import ABCMeta, abstractmethod
from datetime import tzinfo
from math import floor
from pathlib import Path
from queue import Empty, Queue
Expand Down
5 changes: 4 additions & 1 deletion src/clp_logging/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from sys import stderr
from types import TracebackType
from typing import IO, Iterator, List, Match, Optional, Tuple, Type, Union
from zoneinfo import ZoneInfo

from clp_ffi_py.ir import FourByteEncoder
from zstandard import ZstdDecompressionReader, ZstdDecompressor
Expand All @@ -31,6 +30,10 @@
VAR_COMPACT_ENCODING,
)

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

class Log:
"""
Expand Down

0 comments on commit 172a9e0

Please sign in to comment.