All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen.inc: python 3.12: fix datetime deprecation warning
@ 2024-11-18 22:32 Stanley Stanton
  2024-11-19  2:30 ` [meta-virtualization] " Bruce Ashfield
       [not found] ` <18093DBF1757132A.18574@lists.yoctoproject.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Stanley Stanton @ 2024-11-18 22:32 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Stanley Stanton

Datetime.UTC seems is a wrapper for datetime.timezone.utc,
which is available on both python 3.10, and python 3.12 (Ubuntu 24.04)
so, opt to use that instead.

Signed-off-by: Stanley Stanton <stanley.stanton@taitcommunications.com>
---
 recipes-extended/xen/xen.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-extended/xen/xen.inc b/recipes-extended/xen/xen.inc
index dcd281b5..63790f73 100644
--- a/recipes-extended/xen/xen.inc
+++ b/recipes-extended/xen/xen.inc
@@ -151,7 +151,7 @@ def get_build_time_vars(d):
     source_date_epoch = d.getVar('SOURCE_DATE_EPOCH')
     if source_date_epoch is not None:
         import datetime
-        utc_datetime = datetime.datetime.utcfromtimestamp(float(source_date_epoch))
+        utc_datetime =  datetime.datetime.fromtimestamp(float(source_date_epoch), datetime.timezone.utc)
         return " XEN_BUILD_DATE=" + utc_datetime.strftime("%Y-%m-%d") + \
                " XEN_BUILD_TIME=" + utc_datetime.strftime("%H:%M:%S")
     return ""
-- 
2.43.0


-- 

This communication is confidential. We only send and receive email on the
basis of the terms set out at www.taitcommunications.com/email_disclaimer 
<http://www.taitcommunications.com/email_disclaimer>



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-11-25 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 22:32 [PATCH] xen.inc: python 3.12: fix datetime deprecation warning Stanley Stanton
2024-11-19  2:30 ` [meta-virtualization] " Bruce Ashfield
     [not found] ` <18093DBF1757132A.18574@lists.yoctoproject.org>
2024-11-19  2:40   ` Bruce Ashfield
2024-11-19  3:48     ` [PATCH v2] " Stanley Stanton
2024-11-21  4:30       ` [meta-virtualization] " Bruce Ashfield
2024-11-25 20:45         ` Stanley Stanton
2024-11-19  3:49     ` [meta-virtualization] [PATCH] " Stanley Stanton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.