Skip to content

Commit

Permalink
Fix Union compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhozic committed Dec 18, 2022
1 parent c5a1e87 commit 312b309
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/daf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
and functions needed for the framework to run,
as well as user function to control the framework
"""
from __future__ import annotations
from typing import Callable, Coroutine, List, Optional, Union, overload
from contextlib import suppress
from typeguard import typechecked
Expand Down Expand Up @@ -83,7 +82,7 @@ async def initialize(token : str,
server_log_output : Optional[str] =None,
sql_manager: Optional[sql.LoggerSQL]=None,
intents: Optional[dc.Intents]=None,
debug : Optional[ TraceLEVELS | int | str | bool ] = TraceLEVELS.NORMAL,
debug : Optional[ Union[TraceLEVELS, int, str, bool] ] = TraceLEVELS.NORMAL,
proxy: Optional[str]=None,
logger: Optional[logging.LoggerBASE]=None) -> None:
"""
Expand Down Expand Up @@ -405,7 +404,7 @@ def run(token : str,
server_log_output : Optional[str] =None,
sql_manager: Optional[sql.LoggerSQL]=None,
intents: Optional[dc.Intents]=None,
debug : Optional[ TraceLEVELS | int | str | bool ] = TraceLEVELS.NORMAL,
debug : Optional[ Union[TraceLEVELS, int, str, bool] ] = TraceLEVELS.NORMAL,
proxy: Optional[str]=None,
logger: Optional[logging.LoggerBASE]=None) -> None:
"""
Expand Down
6 changes: 3 additions & 3 deletions src/daf/logging/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This modules contains functions and classes
related to the console debug long or trace.
"""
from __future__ import annotations
from typing import Union
from enum import IntEnum, auto
import time
from threading import Lock
Expand Down Expand Up @@ -59,7 +59,7 @@ class GLOBALS:

@misc.doc_category("Tracing")
def trace(message: str,
level: TraceLEVELS | int = TraceLEVELS.NORMAL):
level: Union[TraceLEVELS, int] = TraceLEVELS.NORMAL):
"""
| Prints a trace to the console.
| This is thread safe.
Expand Down Expand Up @@ -97,7 +97,7 @@ def trace(message: str,
print(l_trace)


def initialize(level: TraceLEVELS | int | str):
def initialize(level: Union[TraceLEVELS, int, str]):
"""
Initializes the tracing module
Expand Down

0 comments on commit 312b309

Please sign in to comment.