Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions sentry_sdk/consts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import itertools

from enum import Enum
from sentry_sdk._types import TYPE_CHECKING

Expand Down Expand Up @@ -479,6 +481,7 @@ class ClientConstructor:
def __init__(
self,
dsn=None, # type: Optional[str]
*,
max_breadcrumbs=DEFAULT_MAX_BREADCRUMBS, # type: int
release=None, # type: Optional[str]
environment=None, # type: Optional[str]
Expand Down Expand Up @@ -540,7 +543,7 @@ def __init__(


def _get_default_options():
# type: () -> Dict[str, Any]
# type: () -> dict[str, Any]
import inspect

if hasattr(inspect, "getfullargspec"):
Expand All @@ -550,7 +553,14 @@ def _get_default_options():

a = getargspec(ClientConstructor.__init__)
defaults = a.defaults or ()
return dict(zip(a.args[-len(defaults) :], defaults))
kwonlydefaults = a.kwonlydefaults or {}

return dict(
itertools.chain(
zip(a.args[-len(defaults) :], defaults),
kwonlydefaults.items(),
)
)


DEFAULT_OPTIONS = _get_default_options()
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _init(*args, **kwargs):

This takes the same arguments as the client constructor.
"""
client = Client(*args, **kwargs) # type: ignore
client = Client(*args, **kwargs)
Scope.get_global_scope().set_client(client)
_check_python_deprecations()
rv = _InitGuard(client)
Expand Down