From: Wayne Davison Date: Thu, 16 Jan 2025 06:36:29 +0000 (-0800) Subject: Fix python deprecation warning. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89b847393f53e24c38097153fc8568b85d07289c;p=thirdparty%2Frsync.git Fix python deprecation warning. --- diff --git a/support/git-set-file-times b/support/git-set-file-times index e06f0737..601248b9 100755 --- a/support/git-set-file-times +++ b/support/git-set-file-times @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os, re, argparse, subprocess -from datetime import datetime +from datetime import datetime, UTC NULL_COMMIT_RE = re.compile(r'\0\0commit [a-f0-9]{40}$|\0$') @@ -74,7 +74,7 @@ def print_line(fn, mtime, commit_time): if args.list > 1: ts = str(commit_time).rjust(10) else: - ts = datetime.utcfromtimestamp(commit_time).strftime("%Y-%m-%d %H:%M:%S") + ts = datetime.fromtimestamp(commit_time, UTC).strftime("%Y-%m-%d %H:%M:%S") chg = '.' if mtime == commit_time else '*' print(chg, ts, fn)