From nobody Wed Dec 17 08:56:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744790853; cv=none; d=zohomail.com; s=zohoarc; b=VZjZW2tj4Dip6rxtK/jJccm2G60L0lmypcAbaL2DjEEJCPyRTRYrMwRxea9cd7MoaeWNIfk9BSYmF2X9FNF4d4c5eK9sG80wOcSrV71SB1ve1bfaOiM9IfxGQ3Rqhhcn2XolwDTQQLZwL7isNpUrSCr3KHTVr0qYtx6lmyYMwo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744790853; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=k6cpzekyaK7rTf8zEqFDyjDLbKxHEG3L1H7KPY4U9r4=; b=lKSOsOaz6REPg8xetr+vEz3H31DkCRI9EsRrgnNG0KyCiLR96tGXQu83yZtYIUVH4YILld9c4cndoz5OW0Or4uUKtbC+HD2RgcZy2ywEdkIZPTYslvGvxZ2tQDi3FtniPJltLk/i5WqrJSOG9WQvxHShL/CXWWHFopR6SO2+HOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1744790853580355.100892276561; Wed, 16 Apr 2025 01:07:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id ADC3B1440; Wed, 16 Apr 2025 04:07:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B66D112E6; Wed, 16 Apr 2025 04:07:09 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EBCF912CB; Wed, 16 Apr 2025 04:07:06 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 496C711E8 for ; Wed, 16 Apr 2025 04:07:03 -0400 (EDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-yq5xW-ZzOW6cpycFgSknXg-1; Wed, 16 Apr 2025 04:07:01 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43d6c65dc52so50517275e9.1 for ; Wed, 16 Apr 2025 01:07:01 -0700 (PDT) Received: from wheatley.localdomain ([85.93.96.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39eae97b249sm16560560f8f.58.2025.04.16.01.06.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 01:06:59 -0700 (PDT) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 201DD9F0669F for ; Wed, 16 Apr 2025 10:06:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744790823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nMPIXBg4Fuefeu3gJ0TEArc8UBzpmzl7C6baReN0krA=; b=QdYCJ0PY9B+CY3ly5BeB+bEm1rr8NuiXO2/BaJD2F8Hs3937w7M3bAyI/HCcWJkomMOpzC QDuiqR8XVHYxnKgREtEDmZ4ikExRcudXwryz1ZSC+DX07Lvi+g7GYAZr7LJbE5dfVVQIKa 6Os/xg4sMOvXVY46rsH+Fgv4m3iU/AY= X-MC-Unique: yq5xW-ZzOW6cpycFgSknXg-1 X-Mimecast-MFC-AGG-ID: yq5xW-ZzOW6cpycFgSknXg_1744790820 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744790820; x=1745395620; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nMPIXBg4Fuefeu3gJ0TEArc8UBzpmzl7C6baReN0krA=; b=prXHl2HOtHS1w+wbAUQqEt8Hi6Qk90cJrhx1gXtJdXYadGIfndfAs5Lq/gIhnx+9Ti mn32t2R093zi8C1j5K7sm8yThNWqLRHQo4ZkJkAvrQ7kM5IJaMGtlMQbhMGM+8O3FLEK eclAeQ4fXA3X2K3EvwkL/eP/Dg14eomDrb/EuQo3KORzR7RtoTyLTyx4iyriZ1KUqJO6 xb480+6rkX6DQycneGwm6hedQjOEn9h07y2jtoGbdMLnXDs5GBfs6LoWr6I1ni3U93c0 DBshs/w9QkFkMzEJ7SwYFEPsncjdHI7Bo9dFTuXwEKfEaRJWiJIOhxLd6LHIvfvLChQ1 XTiw== X-Gm-Message-State: AOJu0YxeXdzqiVbtsZ0VEbeLGH/XyGXQtsZ/yAXAXuN1JlJm/o34zEny Qg/zCIOsL3qbDdFQUyQVKOar6jyRJNmKlInbfxPN2nKGntGE0+KZplv4D6hvNo1Wri9/04LfnIc N0AItswx+RYTfbAQW1QvPUz8FEWAQaDfYEFwxW85sND7wLeSMuszjthXrMrgHSKBMoGi0DbdMnY GH0edgKeWv3BWSZAxZdu6rHKDb4kKXt0H9zag45yQ= X-Gm-Gg: ASbGncucRev7tQl+9B0MrvDzfcO2nEf0i+DqZrbB3FoQBviIPwjjIHFP6d/bfXYDWyi 4iOy6KY0onSnuw/fcPfVtTipIySwb9sn/ji0RyvSbRC0kKuyXPF1S7uWq2tC/6Wjf6eg3+Vz2b4 yltFS9WxHKIOBBLeLYh84hy6rF86Qb8aoYW8d7B3YsyvGm6QCnClyKBgDkf4D+RNRvxjG+/2VsK 7ari06UrzrqrZKzA0g0or84Idzac8Ou8lq6unkDI1vJaYOwzK1D/7jygGa8GW9WiKtpfbCyLC3e pio1tIEe2pBtG1a/J273 X-Received: by 2002:a05:600c:698e:b0:43c:f470:7605 with SMTP id 5b1f17b1804b1-4405d624e32mr8571365e9.12.1744790820488; Wed, 16 Apr 2025 01:07:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXg/lKrNzgQGttU2qqeQVKA9UdAPedDoOtGp39cUOCJF/iBw7kZCygODFwbKbXOEhKE9cFAA== X-Received: by 2002:a05:600c:698e:b0:43c:f470:7605 with SMTP id 5b1f17b1804b1-4405d624e32mr8570935e9.12.1744790820121; Wed, 16 Apr 2025 01:07:00 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 2/3] python: Do not explicitly state variables are global when only read Date: Wed, 16 Apr 2025 10:06:54 +0200 Message-ID: <5b169e08e104afcf74606ebe6fffde70d2064ad3.1744790743.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ZdsSlssGZc2ubGsvniiy-4rwuIE_lC2-uycea6uR6BM_1744790820 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XN4QB3XZ4BJ2VC4PDTPKEECKPOWNIS5B X-Message-ID-Hash: XN4QB3XZ4BJ2VC4PDTPKEECKPOWNIS5B X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Martin Kletzander via Devel Reply-To: Martin Kletzander X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744790857979019100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Martin Kletzander If a variable is not modified in a scope there is no need for the use of global in such scope. Without this patch build fails with: F824 `global ...` is unused: name is never assigned in scope It is a bit difficult to find more information on that message and error code, I found it here: https://docs.astral.sh/ruff/rules/global-variable-not-assigned/ Signed-off-by: Martin Kletzander --- scripts/apibuild.py | 6 ------ tools/virt-qemu-qmp-proxy | 1 - 2 files changed, 7 deletions(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 3ecc3eadf7b2..a30e87969aa6 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -818,8 +818,6 @@ class CParser: # Parse a comment block associate to a macro # def parseMacroComment(self, name, quiet=3D0): - global ignored_macros - if name[0:2] =3D=3D '__': quiet =3D 1 if name in ignored_macros: @@ -895,8 +893,6 @@ class CParser: # as possible # def mergeFunctionComment(self, name, description, quiet=3D0): - global ignored_functions - if name =3D=3D 'main': quiet =3D 1 if name[0:2] =3D=3D '__': @@ -1135,8 +1131,6 @@ class CParser: self.lexer.push(tok) =20 def token(self): - global ignored_words - token =3D self.lexer.token() while token is not None: if token[0] =3D=3D 'comment': diff --git a/tools/virt-qemu-qmp-proxy b/tools/virt-qemu-qmp-proxy index dcdb24b9a9eb..39e98e9d5147 100755 --- a/tools/virt-qemu-qmp-proxy +++ b/tools/virt-qemu-qmp-proxy @@ -278,7 +278,6 @@ class QMPProxy(object): else: error =3D True except Exception as e: - global debug if debug: print("%s: %s" % (sys.argv[0], str(e))) print(traceback.format_exc()) --=20 2.49.0