Skip to content

Commit 1c5c431

Browse files
committed
Fix another Python 3.12 deprecation warning
Another usage of utcfromtimestamp, this time in the obstruction map script.
1 parent 1ecaf74 commit 1c5c431

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

dish_obstruction_map.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"""
3232

3333
import argparse
34-
from datetime import datetime
34+
from datetime import datetime, timezone
3535
import logging
3636
import os
3737
import png
@@ -92,8 +92,9 @@ def pixel_bytes(row):
9292
else:
9393
now = int(time.time())
9494
filename = opts.filename.replace("%u", str(now))
95-
filename = filename.replace("%d",
96-
datetime.utcfromtimestamp(now).strftime("%Y_%m_%d_%H_%M_%S"))
95+
filename = filename.replace(
96+
"%d",
97+
datetime.fromtimestamp(now, timezone.utc).strftime("%Y_%m_%d_%H_%M_%S"))
9798
filename = filename.replace("%s", str(opts.sequence))
9899
out_file = open(filename, "wb")
99100
if not snr_data or not snr_data[0]:

0 commit comments

Comments
 (0)