public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Fix deprecated utcnow() usage in build-many-glibcs.py
@ 2024-01-10 13:02 Joseph Myers
  0 siblings, 0 replies; only message in thread
From: Joseph Myers @ 2024-01-10 13:02 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9da45337e4fcaa710e849e8c6baf22341c059e00

commit 9da45337e4fcaa710e849e8c6baf22341c059e00
Author: Joseph Myers <josmyers@redhat.com>
Date:   Wed Jan 10 13:02:16 2024 +0000

    Fix deprecated utcnow() usage in build-many-glibcs.py
    
    Running build-many-glibcs.py with Python 3.12 or later produces a
    warning:
    
    build-many-glibcs.py:566: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
      build_time = datetime.datetime.utcnow()
    
    Replace with datetime.datetime.now(datetime.timezone.utc) (the
    datetime.UTC constant is new in 3.11, so not suitable for use in this
    script at present).

Diff:
---
 scripts/build-many-glibcs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 9a929a6430..ec2ded6e56 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -563,7 +563,7 @@ class Context(object):
                 print(config.name, config.compiler.name)
             return
         self.clear_last_build_state(action)
-        build_time = datetime.datetime.utcnow()
+        build_time = datetime.datetime.now(datetime.timezone.utc)
         if action == 'host-libraries':
             build_components = ('gmp', 'mpfr', 'mpc')
             old_components = ()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-10 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 13:02 [glibc] Fix deprecated utcnow() usage in build-many-glibcs.py Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).