From patchwork Sat Jan 7 23:04:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1722764 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=oXYZLLxE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NqG410vHTz23fs for ; Sun, 8 Jan 2023 10:04:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C71285377; Sun, 8 Jan 2023 00:04:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="oXYZLLxE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 35D4C85377; Sun, 8 Jan 2023 00:04:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 557C383673 for ; Sun, 8 Jan 2023 00:04:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x831.google.com with SMTP id h21so5037808qta.12 for ; Sat, 07 Jan 2023 15:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QhdRNLGq9L6aQhP0AltfbFodAvkL4S+R7+yOEpn272A=; b=oXYZLLxEcCN96vtzk0fhBu7TVxxXb3ozNuunlxmC+no3A4H/QkKjGgmm5lIeiQKdHZ paxst/rq2wJ/BxMOKnSieYtWel61woS1G61y9Y8oQuMb1iZ0H/y19NaoahaUZJbcBT6S 1KFuGD3YJM7kB3Q+HQWimtuSmk+yJsJKC2LD0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QhdRNLGq9L6aQhP0AltfbFodAvkL4S+R7+yOEpn272A=; b=LlS+KHIkxesAa29XSK/6XMON/5mmQ5ex3iYhWgXVLk92/6d7xji9KlFpxctarMUhXB /zh8XJSOocVrHpBvQJh9hNA6e9Lxv4JXJSpUZnNiEt9k8SK8BxnYwDD6Zlj4mEFiM4O7 woAFLyFIBMlvAHSXW12AcpDYgs/K9YZ78Ek8nAskAR5DtJOq9E/jFAnQ7fYudPe8yNwq s7cRwOhbB0rJwIaqMUu1fbhF4iUHqjkg0BjsaL5PbPZteU4vdDvoYKE+XBbmnHzaX+Xy m1K/n1xWjPFAAb4j3FsU8zc9+6b/rOzYlvNt7HRdCHXLDAKAAgJxL6+d17fF+NoADF+M kv+Q== X-Gm-Message-State: AFqh2kooQLQfzWVCE8GipX1TfRdZ4gzbYfEKXkEQA+VrY4iLRCekVd/X SZqMkFTrydPAqCDscAohQTdJ7HJAsbGmSJWVCys= X-Google-Smtp-Source: AMrXdXtW+0KBGn4//dCrk0LJsSDsSqqUEbYy19hN/oNQVfWoi33RsAkxyBz1aJZYgdb/smjBJCqkuw== X-Received: by 2002:ac8:6049:0:b0:3a7:e2bb:d438 with SMTP id k9-20020ac86049000000b003a7e2bbd438mr78671406qtm.52.1673132648082; Sat, 07 Jan 2023 15:04:08 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-64a1-0c30-ebd7-ca7b.res6.spectrum.com. [2603:6081:7b00:6400:64a1:c30:ebd7:ca7b]) by smtp.gmail.com with ESMTPSA id bn39-20020a05620a2ae700b006fed2788751sm2813314qkb.76.2023.01.07.15.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 15:04:07 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: =?utf-8?q?Pali_Roh=C3=A1r?= Subject: [PATCH] pylibfdt: Allow version normalization to fail Date: Sat, 7 Jan 2023 18:04:07 -0500 Message-Id: <20230107230407.2457827-1-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean In some cases, we might not have the sic portion of setuputils available. Make our import and use of this be done in try/except blocks as this is done to suppress a run-time warning that is otherwise non-fatal. Reported-by: Pali Rohár Fixes: 141659187667 ("pylibfdt: Fix disable version normalization") Signed-off-by: Tom Rini --- scripts/dtc/pylibfdt/setup.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/dtc/pylibfdt/setup.py b/scripts/dtc/pylibfdt/setup.py index c07f65e6bcaf..8baae08770ca 100755 --- a/scripts/dtc/pylibfdt/setup.py +++ b/scripts/dtc/pylibfdt/setup.py @@ -20,12 +20,17 @@ allows this script to be run stand-alone, e.g.: ./pylibfdt/setup.py install [--prefix=...] """ -from setuptools import setup, Extension, sic +from setuptools import setup, Extension from setuptools.command.build_py import build_py as _build_py import os import re import sys +try: + from setuptools import sic +except ImportError: + pass + srcdir = os.path.dirname(__file__) with open(os.path.join(srcdir, "../README"), "r") as fh: @@ -113,7 +118,10 @@ progname = sys.argv[0] files = os.environ.get('SOURCES', '').split() cflags = os.environ.get('CPPFLAGS', '').split() objdir = os.environ.get('OBJDIR') -version = os.environ.get('VERSION') +try: + version = sic(os.environ.get('VERSION')) +except: + version = os.environ.get('VERSION') swig_opts = os.environ.get('SWIG_OPTS', '').split() # If we were called directly rather than through our Makefile (which is often @@ -137,7 +145,7 @@ class build_py(_build_py): setup( name='libfdt', - version=sic(version), + version=version, cmdclass = {'build_py' : build_py}, author='Simon Glass', author_email='sjg@chromium.org',