Skip to content

Commit

Permalink
Okay use old syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian committed Apr 22, 2024
1 parent cc1a910 commit 5c22c19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/coredumpy/coredumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pdb
import tokenize
import types
import typing
from typing import Callable, Optional, Union

from .patch import patch_all
from .py_object_proxy import PyObjectProxy
Expand All @@ -19,10 +19,10 @@
class Coredumpy:
@classmethod
def dump(cls,
frame: types.FrameType | None = None,
frame: Optional[types.FrameType] = None,
*,
path: str | typing.Callable[[], str] | None = None,
directory: str | None = None):
path: Optional[Union[str, Callable[[], str]]] = None,
directory: Optional[str] = None):
"""
dump the current frame stack to a file
Expand Down
6 changes: 3 additions & 3 deletions src/coredumpy/except_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@


import sys
import typing
from typing import Callable, Optional, Union

from .coredumpy import dump


_original_excepthook = sys.excepthook


def patch_except(path: str | typing.Callable[[], str] | None = None,
directory: str | None = None):
def patch_except(path: Optional[Union[str, Callable[[], str]]] = None,
directory: Optional[str] = None):
""" Patch the excepthook to dump the frame stack when an unhandled exception occurs.
@param path:
Expand Down

0 comments on commit 5c22c19

Please sign in to comment.