mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-09-30 05:22:14 +08:00
Use non-deprecated API for obtaining UTC time
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). Change-Id: Ia2c46fb87c544d98cc2dd68a829f67d4770b479c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386615 Tested-by: Łukasz Patron <priv.luk@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Łukasz Patron <priv.luk@gmail.com> Commit-Queue: Mike Frysinger <vapier@google.com>
This commit is contained in:
4
repo
4
repo
@@ -173,7 +173,7 @@ if not REPO_REV:
|
||||
BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071"
|
||||
|
||||
# increment this whenever we make important changes to this script
|
||||
VERSION = (2, 36)
|
||||
VERSION = (2, 37)
|
||||
|
||||
# increment this if the MAINTAINER_KEYS block is modified
|
||||
KEYRING_VERSION = (2, 3)
|
||||
@@ -838,7 +838,7 @@ def SetGitTrace2ParentSid(env=None):
|
||||
|
||||
KEY = "GIT_TRACE2_PARENT_SID"
|
||||
|
||||
now = datetime.datetime.utcnow()
|
||||
now = datetime.datetime.now(datetime.timezone.utc)
|
||||
value = "repo-%s-P%08x" % (now.strftime("%Y%m%dT%H%M%SZ"), os.getpid())
|
||||
|
||||
# If it's already set, then append ourselves.
|
||||
|
Reference in New Issue
Block a user