mirror of
https://github.com/ansible/awx.git
synced 2026-07-29 08:59:55 -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:
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime, timedelta, tzinfo
|
||||
from datetime import datetime, timedelta, tzinfo, timezone
|
||||
import inspect
|
||||
import logging
|
||||
import random
|
||||
@@ -364,7 +364,7 @@ def are_same_endpoint(first, second):
|
||||
|
||||
def utcnow():
|
||||
"""Provide a wrapped copy of the built-in utcnow that can be easily mocked."""
|
||||
return datetime.utcnow()
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
|
||||
class UTC(tzinfo):
|
||||
|
||||
Reference in New Issue
Block a user