about summary refs log tree commit diff
path: root/src/tools/publish_toolstate.py
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-15 05:11:39 +0200
committerGitHub <noreply@github.com>2024-10-15 05:11:39 +0200
commitd82a49dba21622ba34e37877281438220cc216f1 (patch)
treef372cd7f87a4fcfb0602c513eeeaab33ffb1bdbb /src/tools/publish_toolstate.py
parent2e2c433be4da62f723a06ce90e3a2dfabc8f2885 (diff)
parenteb6062ce00cce6fa1973466e6b2fb376e3e89cc8 (diff)
downloadrust-d82a49dba21622ba34e37877281438220cc216f1.tar.gz
rust-d82a49dba21622ba34e37877281438220cc216f1.zip
Rollup merge of #131703 - alex:patch-1, r=Kobzol
Resolved python deprecation warning in publish_toolstate.py

`utcnow()` is deprecated in favor of passing a timezone to `now()`. `utcnow()` would return a tz-naive datetime, while this returns a tz-aware datetime. For the purposes of the formatting we do, these are the same.
Diffstat (limited to 'src/tools/publish_toolstate.py')
-rwxr-xr-xsrc/tools/publish_toolstate.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py
index 860d21876de..328b48e04d2 100755
--- a/src/tools/publish_toolstate.py
+++ b/src/tools/publish_toolstate.py
@@ -235,7 +235,9 @@ try:
         exit(0)
 
     cur_commit = sys.argv[1]
-    cur_datetime = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
+    cur_datetime = datetime.datetime.now(datetime.timezone.utc).strftime(
+        '%Y-%m-%dT%H:%M:%SZ'
+    )
     cur_commit_msg = sys.argv[2]
     save_message_to_path = sys.argv[3]
     github_token = sys.argv[4]