Skip to content

Commit

Permalink
chore: Allow to use X | Y syntax for older Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdomke committed Mar 21, 2024
1 parent 7abf3c7 commit 76f9741
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ulid/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import argparse
import shutil
import sys
Expand All @@ -7,7 +9,6 @@
from datetime import datetime
from functools import partial
from typing import Any
from typing import Optional
from uuid import UUID

import ulid
Expand Down Expand Up @@ -97,7 +98,7 @@ def main(argv: Sequence[str], prog: str | None = None) -> str:
return args.func(args)


def from_value_or_stdin(value: str, convert: Optional[Callable[[str], Any]] = None) -> Any:
def from_value_or_stdin(value: str, convert: Callable[[str], Any] | None = None) -> Any:
value = sys.stdin.readline().strip() if value == "-" else value
if convert is not None:
return convert(value)
Expand Down

0 comments on commit 76f9741

Please sign in to comment.