From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1105) id 453903858431; Wed, 10 Jan 2024 13:02:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 453903858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1704891757; bh=HyBLKkRKdxCoRxHcvD5Sr+81B4q1HHwOezu0Yfrmpt0=; h=From:To:Subject:Date:From; b=fDUgsrpOLOZ1aYvGMxxhWXf04y5wUiRb0h7UNjSOB7ialbiOLxC5fgx7SEb7hpklw hKhfXoPyjGD46InU48fitAJyq/dC37xsSxBa+SrUZojXmbo5BS2AEtZyJyzWbhAcr6 zF9umZNlaUSoE/GJZjxijc50uoxoxHn0BxZfqNNY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Joseph Myers To: glibc-cvs@sourceware.org Subject: [glibc] Fix deprecated utcnow() usage in build-many-glibcs.py X-Act-Checkin: glibc X-Git-Author: Joseph Myers X-Git-Refname: refs/heads/master X-Git-Oldrev: 781427354068535f159388776da4f21043e237a8 X-Git-Newrev: 9da45337e4fcaa710e849e8c6baf22341c059e00 Message-Id: <20240110130237.453903858431@sourceware.org> Date: Wed, 10 Jan 2024 13:02:37 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9da45337e4fcaa710e849e8c6baf22341c059e00 commit 9da45337e4fcaa710e849e8c6baf22341c059e00 Author: Joseph Myers 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 = ()