mirror of
https://github.com/ansible/awx.git
synced 2026-07-11 16:28:05 -02:30
AAP-59874: Update to Python 3.12 (#16208)
* update to Python 3.12 * remove use of utcnow * switch to timezone.utc datetime.UTC is an alias of datetime.timezone.utc. if we're doing the double import for datetime it's more straightforward to just import timezone as well and get it directly * debug python env version issue * change python version * pin to SHA and remove debug portion
This commit is contained in:
@@ -8,7 +8,7 @@ import logging.handlers
|
||||
import sys
|
||||
import traceback
|
||||
import os
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
@@ -50,7 +50,7 @@ class RSysLogHandler(logging.handlers.SysLogHandler):
|
||||
# because the alternative is blocking the
|
||||
# socket.send() in the Python process, which we definitely don't
|
||||
# want to do)
|
||||
dt = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
|
||||
dt = datetime.now(timezone.utc).strftime('%Y-%m-%d %H:%M:%S')
|
||||
msg = f'{dt} ERROR rsyslogd was unresponsive: '
|
||||
exc = traceback.format_exc()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user