mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Fix "'NoneType' has no attribute start|stop" logcontext errors (#7181)
Fixes #7179.
This commit is contained in:
parent
fe1580bfd9
commit
60adcbed91
3 changed files with 12 additions and 7 deletions
|
@ -539,6 +539,11 @@ def set_current_context(context: LoggingContextOrSentinel) -> LoggingContextOrSe
|
|||
Returns:
|
||||
The context that was previously active
|
||||
"""
|
||||
# everything blows up if we allow current_context to be set to None, so sanity-check
|
||||
# that now.
|
||||
if context is None:
|
||||
raise TypeError("'context' argument may not be None")
|
||||
|
||||
current = current_context()
|
||||
|
||||
if current is not context:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue