Skip to content

Commit 312b309

Browse files
committed
Fix Union compatibility
1 parent c5a1e87 commit 312b309

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/daf/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
and functions needed for the framework to run,
44
as well as user function to control the framework
55
"""
6-
from __future__ import annotations
76
from typing import Callable, Coroutine, List, Optional, Union, overload
87
from contextlib import suppress
98
from typeguard import typechecked
@@ -83,7 +82,7 @@ async def initialize(token : str,
8382
server_log_output : Optional[str] =None,
8483
sql_manager: Optional[sql.LoggerSQL]=None,
8584
intents: Optional[dc.Intents]=None,
86-
debug : Optional[ TraceLEVELS | int | str | bool ] = TraceLEVELS.NORMAL,
85+
debug : Optional[ Union[TraceLEVELS, int, str, bool] ] = TraceLEVELS.NORMAL,
8786
proxy: Optional[str]=None,
8887
logger: Optional[logging.LoggerBASE]=None) -> None:
8988
"""
@@ -405,7 +404,7 @@ def run(token : str,
405404
server_log_output : Optional[str] =None,
406405
sql_manager: Optional[sql.LoggerSQL]=None,
407406
intents: Optional[dc.Intents]=None,
408-
debug : Optional[ TraceLEVELS | int | str | bool ] = TraceLEVELS.NORMAL,
407+
debug : Optional[ Union[TraceLEVELS, int, str, bool] ] = TraceLEVELS.NORMAL,
409408
proxy: Optional[str]=None,
410409
logger: Optional[logging.LoggerBASE]=None) -> None:
411410
"""

src/daf/logging/tracing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This modules contains functions and classes
33
related to the console debug long or trace.
44
"""
5-
from __future__ import annotations
5+
from typing import Union
66
from enum import IntEnum, auto
77
import time
88
from threading import Lock
@@ -59,7 +59,7 @@ class GLOBALS:
5959

6060
@misc.doc_category("Tracing")
6161
def trace(message: str,
62-
level: TraceLEVELS | int = TraceLEVELS.NORMAL):
62+
level: Union[TraceLEVELS, int] = TraceLEVELS.NORMAL):
6363
"""
6464
| Prints a trace to the console.
6565
| This is thread safe.
@@ -97,7 +97,7 @@ def trace(message: str,
9797
print(l_trace)
9898

9999

100-
def initialize(level: TraceLEVELS | int | str):
100+
def initialize(level: Union[TraceLEVELS, int, str]):
101101
"""
102102
Initializes the tracing module
103103

0 commit comments

Comments
 (0)