xfs_scrub_all: Replace deprecated datetime.utcnow
PATCH 1/1 xfs_scrub_all: Replace deprecated datetime.utcnow
Python 3.12 has deprecated datetime.datetime.utcnow. Replace it with datetime.datetime.now with timezone object.
Closes #1112588
Signed-off-by Bastian Germann <[email protected]>
--- scrub/xfs_scrub_all.py.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
scrub/xfs_scrub_all.py.in +1 -2
@@ -496,8 +496,7 @@ def scan_interval(string): def utcnow(): '''Create a representation of the time right now, in UTC.''' - dt = datetime.utcnow() - return dt.replace(tzinfo = timezone.utc) + return datetime.now(timezone.utc) def enable_automatic_media_scan(args): '''Decide if we enable media scanning automatically.'''