Skip to content

Commit 8ff14cd

Browse files
authored
Union syntax compatibility with pre- Python 3.10 (#106)
We probably shouldn't be supporting EOL'd Pythons, but setup.py and CONTRIBUTING.rst both say Python 3.6+ at this time, and the code does not run on Python 3.6. The easy fix for now is to use "from tying import Union"; a better fix for the future would be to advance this project to Python 3.10+.
1 parent 3aab163 commit 8ff14cd

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Changelog
22

3-
## Upcoming
3+
## Version 2.10.1
44

5-
(released on TBD)
5+
(released on 2025-02-18)
66

77
- Update license dates.
88
- Change `master` branch references to `main`.
9+
- Provisional Python 3.6 compatibility (Union syntax).
910

1011
## Version 2.10.0
1112

cli_helpers/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import re
77
from functools import lru_cache
8-
from typing import Dict
8+
from typing import Dict, Union
99

1010
from typing import TYPE_CHECKING
1111

@@ -119,7 +119,7 @@ def replace(s, replace):
119119

120120

121121
@lru_cache()
122-
def _get_formatter(style) -> Terminal256Formatter | TerminalTrueColorFormatter:
122+
def _get_formatter(style) -> Union[Terminal256Formatter, TerminalTrueColorFormatter]:
123123
if "truecolor" in os.getenv("COLORTERM", "").lower():
124124
return TerminalTrueColorFormatter(style=style)
125125
else:

0 commit comments

Comments
 (0)