Skip to content

Commit

Permalink
Fix type error by using Tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
danielzwlee committed Mar 9, 2023
1 parent 33c414f commit a362403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/allmydata/util/time_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from future.utils import native_str

import calendar, datetime, re, time
from typing import Union, Optional, Pattern, Callable
from typing import Union, Optional, Pattern, Callable, Tuplegit
from typing_extensions import TypeAlias
_TimeTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int]
_TimeTuple: TypeAlias = Tuple[int, int, int, int, int, int, int, int, int]

def format_time(t: Union[_TimeTuple, time.struct_time]) -> str:
return time.strftime("%Y-%m-%d %H:%M:%S", t)
Expand Down

0 comments on commit a362403

Please sign in to comment.