Skip to content

Commit

Permalink
Rollup merge of #131703 - alex:patch-1, r=Kobzol
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Oct 15, 2024
2 parents 2e2c433 + eb6062c commit d82a49d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/publish_toolstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def update_latest(
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]
Expand Down

0 comments on commit d82a49d

Please sign in to comment.