You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a note for the maintainer or anyone who may run into this, In Python 3.13 the typing.io namespace was removed. You need to import the types directly from the typing module. I'm no python expert so there may be a better approach, but here are the changes I made to colr.py to get things working with python 3.13.
--- colr.py.orig 2024-12-25 16:26:24.188215303 -0600+++ colr.py 2024-12-25 16:43:58.837710220 -0600@@ -48,8 +48,10 @@
Tuple,
Union,
cast,
+ TextIO, # MORPH 12/25/2024 - import directly from typing module
)
-from typing.io import IO+#MORPH 12/25/2024 - In Python 3.13, the typing.io namespace+#has been removed. You can import the types directly from the typing module
from .base import (
ChainedBase,
@@ -158,7 +160,7 @@
def auto_disable(
enabled: Optional[bool] = True,
- fds: Optional[Sequence[IO]] = (sys.stdout, sys.stderr)) -> None:+ fds: Optional[Sequence[TextIO]] = (sys.stdout, sys.stderr)) -> None: #MORPH 12/25/2024
""" Automatically decide whether to disable color codes if stdout or
stderr are not ttys.
@@ -173,7 +175,7 @@
if enabled:
allttys = all(
getattr(f, 'isatty', lambda: False)()
- for f in cast(Sequence[IO], fds)+ for f in cast(Sequence[TextIO], fds) #MORPH 12/25/2024
)
if not allttys:
disable()
The text was updated successfully, but these errors were encountered:
Just a note for the maintainer or anyone who may run into this, In Python 3.13 the typing.io namespace was removed. You need to import the types directly from the typing module. I'm no python expert so there may be a better approach, but here are the changes I made to
colr.py
to get things working with python 3.13.The text was updated successfully, but these errors were encountered: