Skip to content

Commit ab789c8

Browse files
authored
Unrolled build for rust-lang#131703
Rollup merge of rust-lang#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.
2 parents 00367d5 + eb6062c commit ab789c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/tools/publish_toolstate.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ def update_latest(
235235
exit(0)
236236

237237
cur_commit = sys.argv[1]
238-
cur_datetime = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')
238+
cur_datetime = datetime.datetime.now(datetime.timezone.utc).strftime(
239+
'%Y-%m-%dT%H:%M:%SZ'
240+
)
239241
cur_commit_msg = sys.argv[2]
240242
save_message_to_path = sys.argv[3]
241243
github_token = sys.argv[4]

0 commit comments

Comments
 (0)