Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion homeassistant/helpers/config_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def deprecated(
- No warning if neither key nor replacement_key are provided
- Adds replacement_key with default value in this case
"""
module = inspect.getmodule(inspect.stack()[1][0])
module = inspect.getmodule(inspect.stack(context=1)[1].frame)
Comment thread
emontnemery marked this conversation as resolved.
Outdated
if module is not None:
module_name = module.__name__
else:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_deprecated(
and a warning is issued to the user.
"""
if old_name in config:
module = inspect.getmodule(inspect.stack()[1][0])
module = inspect.getmodule(inspect.stack(context=0)[1].frame)
if module is not None:
module_name = module.__name__
else:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/util/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _async_stop_queue_handler(_: Any) -> None:

def log_exception(format_err: Callable[..., Any], *args: Any) -> None:
"""Log an exception with additional context."""
module = inspect.getmodule(inspect.stack()[1][0])
module = inspect.getmodule(inspect.stack(context=0)[1].frame)
if module is not None:
module_name = module.__name__
else:
Expand Down