☂ Make sure _srcfile exists

This commit is contained in:
Gina Häußge committed 2020-06-18 15:21:19 +02:00
1 parent 0ac205cdf2
commit eeaac73a5d
1 file changed
+4 -1
+4 -1
View File
@@ -20,8 +20,11 @@ def log_to_handler(logger, handler, level, msg, exc_info=None, extra=None, *args
extra: optional extra data
*args: log args
"""
from logging import _srcfile
import sys
try:
from logging import _srcfile
except ImportError:
_srcfile = None
# this is just the same as logging.Logger._log