mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 01:46:24 +01:00
Use asgiref for threadlocals if available
This commit is contained in:
parent
4126aff021
commit
b020a6e785
@ -1,6 +1,11 @@
|
||||
from threading import local
|
||||
from warnings import warn
|
||||
|
||||
|
||||
try:
|
||||
from asgiref.local import Local
|
||||
except ImportError: # fallback for Django <3.0
|
||||
from threading import local as Local
|
||||
|
||||
from wagtail.core import hooks
|
||||
from wagtail.utils.deprecation import RemovedInWagtail217Warning
|
||||
|
||||
@ -31,7 +36,7 @@ class LogFormatter:
|
||||
return self.comment
|
||||
|
||||
|
||||
_active = local()
|
||||
_active = Local()
|
||||
|
||||
|
||||
class LogContext:
|
||||
|
Loading…
Reference in New Issue
Block a user