Fix datetime.utcnow() deprecation warning

Running stack.sh on a python 3.12 system generates this
warning from worlddump.py:

  DeprecationWarning: datetime.datetime.utcnow() is deprecated

Use datetime.now(timezone.utc) instead, which should be
backwards-compatible with older python versions.

TrivialFix

Change-Id: I11fe60f6b04842412045c6cb97f493f7fef66e1a
This commit is contained in:
Brian Haley 2024-04-23 15:37:37 -04:00
parent b6613b1e71
commit 9be4ceeaa1

View File

@ -51,7 +51,7 @@ def get_options():
def filename(dirname, name=""):
now = datetime.datetime.utcnow()
now = datetime.datetime.now(datetime.timezone.utc)
fmt = "worlddump-%Y-%m-%d-%H%M%S"
if name:
fmt += "-" + name