0
0
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:
Matt Westcott 2021-06-30 15:51:21 +01:00 committed by Matt Westcott
parent 4126aff021
commit b020a6e785

View File

@ -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: