From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033096; cv=none; d=zohomail.com; s=zohoarc; b=c6bB0hCtX8F+Ug8NB7gG7XBTHIv6ffMpXJaWLhkl+XchtIDyHNENnVREEx5cFw9XXRchYrms8D7HfH3MmGVMOZoD2W1Qo+KIow4IlZdkFWuMy+eZAeWSfSLwdAf//xBuUlOsRKxbDQCc7wIGARf41Xtr0zYIliyO0plQEGgdGi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033096; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dBDmtrRvyGaqpX9R6oNckztnlUNPJGk6TWXJdfpggVY=; b=XhU0vFpTz+WFka6ydDNbQ6BpQjd2YcqAoke1+7okozBWgcmx37FPQ3JdTyu0ta4i/R3YIlNKhFWon8eL4ciaKzSg+DLAIzLNNn+P8udr+IOXRYjwneEovObmMIluzb5URUkO6uEf19cjvRgyc+WW9pg7ZeJaZjEMtSmrD6D3tUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161903309690368.27355018792127; Wed, 21 Apr 2021 12:24:56 -0700 (PDT) Received: from localhost ([::1]:48212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZISz-0005NZ-Sr for importer@patchew.org; Wed, 21 Apr 2021 15:24:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQu-0003eG-KP for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQr-0005Wa-QR for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:43 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-7_531YaQMPigIlyk-TdHyg-1; Wed, 21 Apr 2021 15:22:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA57E87A826; Wed, 21 Apr 2021 19:22:35 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3B375C1B4; Wed, 21 Apr 2021 19:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dBDmtrRvyGaqpX9R6oNckztnlUNPJGk6TWXJdfpggVY=; b=RuR2/lu8z9S8m5G7rCWVCNDqIaKgbmEMr9Sc2enuUFaxy1rf7q0rOvZQvoUf0HB71ytgm/ mcDOZqX55Foa1UVKfZoXj0RBP+C2FZNtLE8q2UKGMICtIAfv3WE/J2OK4ZeOmod+qH2cbd AohRIerLmNs7INcqh88xQsNS6d1cXfQ= X-MC-Unique: 7_531YaQMPigIlyk-TdHyg-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 1/8] qapi/error: Repurpose QAPIError as an abstract base exception class Date: Wed, 21 Apr 2021 15:22:26 -0400 Message-Id: <20210421192233.3542904-2-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Rename QAPIError to QAPISourceError, and then create a new QAPIError class that serves as the basis for all of our other custom exceptions, without specifying any class properties. This leaves QAPIError as a package-wide error class that's suitable for any current or future errors. (Right now, we don't have any errors that DON'T also want to specify a Source location, but this MAY change. In these cases, a common abstract ancestor would be desired.) Add docstrings to explain the intended function of each error class. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- docs/sphinx/qapidoc.py | 3 ++- scripts/qapi/error.py | 11 +++++++++-- scripts/qapi/schema.py | 5 +++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index b7a2d39c105..87c67ab23f8 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -34,7 +34,8 @@ from sphinx.util.nodes import nested_parse_with_titles import sphinx from qapi.gen import QAPISchemaVisitor -from qapi.schema import QAPIError, QAPISemError, QAPISchema +from qapi.error import QAPIError, QAPISemError +from qapi.schema import QAPISchema =20 =20 # Sphinx up to 1.6 uses AutodocReporter; 1.7 and later diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index ae60d9e2fe8..126dda7c9b2 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -13,6 +13,11 @@ =20 =20 class QAPIError(Exception): + """Base class for all exceptions from the QAPI package.""" + + +class QAPISourceError(QAPIError): + """Error class for all exceptions identifying a source location.""" def __init__(self, info, col, msg): Exception.__init__(self) self.info =3D info @@ -27,7 +32,8 @@ def __str__(self): return loc + ': ' + self.msg =20 =20 -class QAPIParseError(QAPIError): +class QAPIParseError(QAPISourceError): + """Error class for all QAPI schema parsing errors.""" def __init__(self, parser, msg): col =3D 1 for ch in parser.src[parser.line_pos:parser.pos]: @@ -38,6 +44,7 @@ def __init__(self, parser, msg): super().__init__(parser.info, col, msg) =20 =20 -class QAPISemError(QAPIError): +class QAPISemError(QAPISourceError): + """Error class for semantic QAPI errors.""" def __init__(self, info, msg): super().__init__(info, None, msg) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 703b446fd21..c277fcacc53 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -20,7 +20,7 @@ from typing import Optional =20 from .common import POINTER_SUFFIX, c_name -from .error import QAPIError, QAPISemError +from .error import QAPISemError, QAPISourceError from .expr import check_exprs from .parser import QAPISchemaParser =20 @@ -875,7 +875,8 @@ def _def_entity(self, ent): other_ent =3D self._entity_dict.get(ent.name) if other_ent: if other_ent.info: - where =3D QAPIError(other_ent.info, None, "previous defini= tion") + where =3D QAPISourceError(other_ent.info, None, + "previous definition") raise QAPISemError( ent.info, "'%s' is already defined\n%s" % (ent.name, where)) --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033093; cv=none; d=zohomail.com; s=zohoarc; b=Mr+mU9TQt0jKYPd2wNdIHAdcVzN90JkFOXJJwV33WuUa0N510GJRbTyynFFq3cZnvoUwOrgK6RmI33nsD6llRVqNWaB1cEqY6Cb97X7VqPPu9TTW21UDDE+HrOhaITE0hWKJfOeGHa1Rf5zC3BQR/EFy9h4EvYq1UCzjLjHpWl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=99DEEllPzNQalb3WGQwj/ArABxJ3NhtgsKM35wwXMSk=; b=FNHiRZalYHEhRz1FvuKC++Us2K3pDSnNvoofDW+bCAdgHjvY8rHN+8zsM/l6JCQMwnqj42OxnxMfDc2YrmInNyIZsSty5fxZuHfPd8e41kgxoxj2vPuPE6EqtT4QCI6YKF6duIH4O4NpwWVEoJEPBXrgF9nrAcsHB0B6YtLILxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033093070394.29313550822144; Wed, 21 Apr 2021 12:24:53 -0700 (PDT) Received: from localhost ([::1]:48096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZISx-0005Kx-KE for importer@patchew.org; Wed, 21 Apr 2021 15:24:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQu-0003fi-Oo for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQq-0005VI-Rh for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:44 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-8yYztLoyOwqS3FGY3kwORA-1; Wed, 21 Apr 2021 15:22:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1E1C801983; Wed, 21 Apr 2021 19:22:36 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id F18F85C1B4; Wed, 21 Apr 2021 19:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=99DEEllPzNQalb3WGQwj/ArABxJ3NhtgsKM35wwXMSk=; b=Pkfsk48pcL1n0Ftu6k1FGfzCAzR7PB2gUDOZ6eOotMeTGU0sw9/hU32fs2XxBkoObsL6iS 0uEJX73wx5kFDfQjEco9XW0L8m9q75/qBCmlWxr2HyZa/5TG1jP8gQgXeGmcKw+DIwdLuW xoxifm6ArSkKDCeIN9/ICWZtJhRSkQk= X-MC-Unique: 8yYztLoyOwqS3FGY3kwORA-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 2/8] qapi/error: Use Python3-style super() Date: Wed, 21 Apr 2021 15:22:27 -0400 Message-Id: <20210421192233.3542904-3-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Missed in commit 2cae67bcb5 "qapi: Use super() now we have Python 3". Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/error.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index 126dda7c9b2..38bd7c4dd6a 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -19,7 +19,7 @@ class QAPIError(Exception): class QAPISourceError(QAPIError): """Error class for all exceptions identifying a source location.""" def __init__(self, info, col, msg): - Exception.__init__(self) + super().__init__() self.info =3D info self.col =3D col self.msg =3D msg --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033257; cv=none; d=zohomail.com; s=zohoarc; b=HvMDHQDippP7WmvpY7n3jO9a1id2p7W1keHidaVDFbk8dpMAEwXoTDCSPcTAbHefYAQAq/SWArf65QBZx9bQapqteGaMb+OkGOgpdigxiEwZ4QRCfRft9i35eafKf8qlBb6Xk1zpcSnd2+by4xNodOhUAjGdyZqR7cVBJXnqeS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033257; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oNjYbJmAWqqsSY03QnHmyUPUGm5MRQ02Y2/NtVK6rIg=; b=H7NmNepmy1zS0Ulo5G83toIRJa+rJnyv8ppEjq4QO9AXYYRVlO4F53/STq/xJkbe4+A41PKGiCq1rZfz2OYlyFhtmmSB0/qc2F965Su2iqwZlDQtneG6+w09QCozAqBSnWyHj8WdNw7xEW0qvulOES8khKCdN+hXJQdwA8sd/5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033257976358.0131252620056; Wed, 21 Apr 2021 12:27:37 -0700 (PDT) Received: from localhost ([::1]:56660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIVc-0000Qq-WD for importer@patchew.org; Wed, 21 Apr 2021 15:27:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQw-0003hu-2Q for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24007) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQr-0005Wg-Tn for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-565-zMb1oKDsPAWXXj-mx50pYw-1; Wed, 21 Apr 2021 15:22:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8094107ACCA; Wed, 21 Apr 2021 19:22:37 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8D395C1B4; Wed, 21 Apr 2021 19:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oNjYbJmAWqqsSY03QnHmyUPUGm5MRQ02Y2/NtVK6rIg=; b=KV/wr8otm0Xs3m4+pPdz27ElCR8YGh8sKvo2n5ZjnRO5B0YHmVvNMMEq7jWKzbpsjIX9zI qrndx2bpEAy8AkZ40zS3/VNE3Qhk4+i8lTVpmblpwHTgv+qJaa4EMrL2BlXNrGYS3QguaL tNNT7ZhtCAoaOxTBpsoviqwp4lPDwtQ= X-MC-Unique: zMb1oKDsPAWXXj-mx50pYw-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 3/8] qapi/error: Make QAPISourceError 'col' parameter optional Date: Wed, 21 Apr 2021 15:22:28 -0400 Message-Id: <20210421192233.3542904-4-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It's already treated as optional, with one direct caller and some subclass callers passing 'None'. Make it officially optional, which requires moving the position of the argument to come after all required parameters. QAPISemError becomes functionally identical to QAPISourceError. Keep the name to preserve its semantic meaning and avoid code churn, but remove the now-useless __init__ wrapper. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/error.py | 8 +++----- scripts/qapi/schema.py | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index 38bd7c4dd6a..d179a3bd0c7 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -18,11 +18,11 @@ class QAPIError(Exception): =20 class QAPISourceError(QAPIError): """Error class for all exceptions identifying a source location.""" - def __init__(self, info, col, msg): + def __init__(self, info, msg, col=3DNone): super().__init__() self.info =3D info - self.col =3D col self.msg =3D msg + self.col =3D col =20 def __str__(self): loc =3D str(self.info) @@ -41,10 +41,8 @@ def __init__(self, parser, msg): col =3D (col + 7) % 8 + 1 else: col +=3D 1 - super().__init__(parser.info, col, msg) + super().__init__(parser.info, msg, col) =20 =20 class QAPISemError(QAPISourceError): """Error class for semantic QAPI errors.""" - def __init__(self, info, msg): - super().__init__(info, None, msg) diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index c277fcacc53..3a4172fb749 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -875,8 +875,7 @@ def _def_entity(self, ent): other_ent =3D self._entity_dict.get(ent.name) if other_ent: if other_ent.info: - where =3D QAPISourceError(other_ent.info, None, - "previous definition") + where =3D QAPISourceError(other_ent.info, "previous defini= tion") raise QAPISemError( ent.info, "'%s' is already defined\n%s" % (ent.name, where)) --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033397; cv=none; d=zohomail.com; s=zohoarc; b=ZN/o4TyzOJC4pLvOWXAGU3HbeBB00RCKK9oTt4WHo5OG1d3FlsxbvvTVz8OglcI0hK1CjWc+AJijjlKuD/xpkC51/utDDprri+nnCPQV+GrlETG9v4gzFtXZjxq41cNRB+LzR96tcD/V4yj2UCjD+krJH+YDxsWGWBb98cZ6IoA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033397; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O1UFhIcIO1sB0rYOq17pQK4R3ILF1OU6LlNmhkawpmk=; b=DHJVaW1z1PpyKvWtTVaqz8jLxERcDPB24BIl+Vk8xDJJqjbTqJ8tRtt3gzKlvk5AHVZeH2Mb3MOTPRKN+fO+LdwE0qrCdnrPhWr2ycKSVGXfNnuRBXiBz2QsodAxwSwWqEXq4Nm/5t6I2V07JO+Pnnasnhoid9NZVFHqir2Kk0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033397392633.081861189286; Wed, 21 Apr 2021 12:29:57 -0700 (PDT) Received: from localhost ([::1]:36720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIXq-0003lP-1d for importer@patchew.org; Wed, 21 Apr 2021 15:29:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIR3-0003yk-KQ for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIR1-0005dL-TB for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:53 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-37xIrnzTPS2564t1Q9xF3w-1; Wed, 21 Apr 2021 15:22:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B230780432C; Wed, 21 Apr 2021 19:22:38 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDBD25C1D5; Wed, 21 Apr 2021 19:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O1UFhIcIO1sB0rYOq17pQK4R3ILF1OU6LlNmhkawpmk=; b=Ddft+qdURdtAn5dyon9fVxB4DPKVmJrcsueOTZ2m67sdjpbhECbc2KdaKxjNwvk5+5PcE3 Y3nm+GD6bzIHsAZ2RX2iDKXcLgPuRRv4hx30AuQl1HaK9cQj4eJLedHxP6WcHBnDrhnj9P K5BeCJGnep5h/YuxZmBL/R9+s1/6APg= X-MC-Unique: 37xIrnzTPS2564t1Q9xF3w-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 4/8] qapi/error: assert QAPISourceInfo is not None Date: Wed, 21 Apr 2021 15:22:29 -0400 Message-Id: <20210421192233.3542904-5-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Built-in stuff is not parsed from a source file, and therefore have no QAPISourceInfo. If such None info was used for reporting an error, built-in stuff would be broken. Programming error. Instead of reporting a confusing error with bogus source location then, we better crash. We currently crash only if self.col was set. Assert that self.info is not None in order to crash reliably. We can not yet change the type of the initializer to prove this cannot happen at static analysis time before the remainder of the code is fully typed. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/error.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index d179a3bd0c7..d0bc7af6e76 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -25,6 +25,7 @@ def __init__(self, info, msg, col=3DNone): self.col =3D col =20 def __str__(self): + assert self.info is not None loc =3D str(self.info) if self.col is not None: assert self.info.line is not None --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033272; cv=none; d=zohomail.com; s=zohoarc; b=ilqk3p9ZHnZyAWGm4wBGSh/suP+KQhvuckcsh4TB49FhYjZfO9qfvq5gic2f+JLAiJjk+nFf4Y2rbBlmLUlSrJ/EiAsgVW7XV3P2yw6KKeH+dNTq2OnN/+KAukIFkufriRh+UgAaVYIhuigKNNSrNFgWqqiD3eXH0OyO8fDCL9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033272; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EW3Kri7fJM7UoCzllKDsdwY/tpGuX1B83+UwKw9TpzE=; b=ZJdeor3BZwcFHone9V98YMREs7v8Cw0Ykc59hik2jvm1ZW/3LOSY3zjeKISEJMF5Hh9+ipCrM+PjdvkxHPMRUly7xjLL/JytgsAIeRHE5mZ62Fif8MEZUX4oAlB2xxfLnn1PL8NWdrQiZB2lPCNLmxbhRH3bxzwvFGsLLjCdoc8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033272563494.8062233195966; Wed, 21 Apr 2021 12:27:52 -0700 (PDT) Received: from localhost ([::1]:56758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIVn-0000T4-NA for importer@patchew.org; Wed, 21 Apr 2021 15:27:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQz-0003ql-SS for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQy-0005aZ-1h for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-m5HAR9SqMNuEen7JqLG_ug-1; Wed, 21 Apr 2021 15:22:40 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A780B87A83C; Wed, 21 Apr 2021 19:22:39 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id D88BA5C1B4; Wed, 21 Apr 2021 19:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EW3Kri7fJM7UoCzllKDsdwY/tpGuX1B83+UwKw9TpzE=; b=VWjsgDsMXImVm3ilz6qfSLn/QsjKZ1TooWaPwBOhoZOM0DsnvNRmr61UYXCBiXnPkvz4W0 8fKY9yQiaXU7FCYjrYvgrmdrKaFDSXwwKV/sBpS8IVbQM8G/1lr05XwegdzzGqPuE4VMdX jqixSicnZDmwhxZ3Z4NZELkxD0qqE5E= X-MC-Unique: m5HAR9SqMNuEen7JqLG_ug-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 5/8] qapi/error.py: move QAPIParseError to parser.py Date: Wed, 21 Apr 2021 15:22:30 -0400 Message-Id: <20210421192233.3542904-6-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Keeping it in error.py will create some cyclic import problems when we add types to the QAPISchemaParser. Callers don't need to know the details of QAPIParseError unless they are parsing or dealing directly with the parser, so this won't create any harsh new requirements for callers in the general case. Update error.py with a little docstring that gives a nod to where the error may now be found. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/error.py | 22 ++++++++-------------- scripts/qapi/parser.py | 14 +++++++++++++- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index d0bc7af6e76..6723c5a9d9a 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- # -# QAPI error classes -# # Copyright (c) 2017-2019 Red Hat Inc. # # Authors: @@ -11,6 +9,14 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +""" +QAPI error classes + +Common error classes used throughout the package. Additional errors may +be defined in other modules. At present, `QAPIParseError` is defined in +parser.py. +""" + =20 class QAPIError(Exception): """Base class for all exceptions from the QAPI package.""" @@ -33,17 +39,5 @@ def __str__(self): return loc + ': ' + self.msg =20 =20 -class QAPIParseError(QAPISourceError): - """Error class for all QAPI schema parsing errors.""" - def __init__(self, parser, msg): - col =3D 1 - for ch in parser.src[parser.line_pos:parser.pos]: - if ch =3D=3D '\t': - col =3D (col + 7) % 8 + 1 - else: - col +=3D 1 - super().__init__(parser.info, msg, col) - - class QAPISemError(QAPISourceError): """Error class for semantic QAPI errors.""" diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 58267c3db9e..ca5e8e18e00 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -18,10 +18,22 @@ import os import re =20 -from .error import QAPIParseError, QAPISemError +from .error import QAPISemError, QAPISourceError from .source import QAPISourceInfo =20 =20 +class QAPIParseError(QAPISourceError): + """Error class for all QAPI schema parsing errors.""" + def __init__(self, parser, msg): + col =3D 1 + for ch in parser.src[parser.line_pos:parser.pos]: + if ch =3D=3D '\t': + col =3D (col + 7) % 8 + 1 + else: + col +=3D 1 + super().__init__(parser.info, msg, col) + + class QAPISchemaParser: =20 def __init__(self, fname, previously_included=3DNone, incl_info=3DNone= ): --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033243; cv=none; d=zohomail.com; s=zohoarc; b=K4AfHmcNU/Vi0Cig6TiDA3lm+b6KhpyV6B1HpdQLViZvMbUcrQItw3gySPVBfOlscpByls0Qi4vylLLYsTXHKTdAhzIJmFD5Erx207CnGbsEilsTUzcr/e5fNtYn/xgBlZUUCXyNl40naY8QZ0SifUmBxMfsYtPIQCReU+8d8h8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033243; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1HZ54izTjiISS10lHuMMPhWPYTcoMyywaeGobK3r3Nw=; b=c3VIMRFa5B8bnSamOZ9ZZODGWer61wuLqD8hNtXhpkl4pI0AGaAv6WLqDbGgGBUBWc+5eRmoveFZK72gKUXklN+7Ky7Ql6mkyxcXo+RQTEyV7YQZzAHEHS4ZwedFnuyW91GgvMc4iYiRJoSBb9qyhZk9TLQy52v/vBT7Qhzz/Ek= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033243638312.17601946591856; Wed, 21 Apr 2021 12:27:23 -0700 (PDT) Received: from localhost ([::1]:55902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIVO-000070-Ke for importer@patchew.org; Wed, 21 Apr 2021 15:27:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQw-0003j0-JX for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQv-0005Yw-3F for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:46 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-ktbQ7b1ePGmup3oDaM57Lw-1; Wed, 21 Apr 2021 15:22:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DBEB189829A; Wed, 21 Apr 2021 19:22:40 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0CC75C1B4; Wed, 21 Apr 2021 19:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1HZ54izTjiISS10lHuMMPhWPYTcoMyywaeGobK3r3Nw=; b=KnyVHmGoMkd6HuqsNseq5jevm1zdmpE2+Y7MjFcjM+UfAUimNom94dJhOzTi0ZazpnWDrg aloAWTz2qhr1U6YdiEAJREEyLsAcN0g+fe0jnMRtiQLCIlsgw965ipxoi77J6aai5RWjqQ CnWm1g2Ew3uCSxNrTZdIfA1ImTJK8Vk= X-MC-Unique: ktbQ7b1ePGmup3oDaM57Lw-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 6/8] qapi/error.py: enable pylint checks Date: Wed, 21 Apr 2021 15:22:31 -0400 Message-Id: <20210421192233.3542904-7-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/pylintrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc index fb0386d529a..88efbf71cb2 100644 --- a/scripts/qapi/pylintrc +++ b/scripts/qapi/pylintrc @@ -2,8 +2,7 @@ =20 # Add files or directories matching the regex patterns to the ignore list. # The regex matches against base names, not paths. -ignore-patterns=3Derror.py, - parser.py, +ignore-patterns=3Dparser.py, schema.py, =20 =20 --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033623; cv=none; d=zohomail.com; s=zohoarc; b=Fstk/mgdGN/n6hrP7uIA0gW0uy/E8XZn3I1wz3ygYKxWzpx6anLNrZx7trHfqcNgfwP+BVv/wBwxqWMi2gWrF0O8cYFw+82pfxapSEqYVKclDZRXFJq9S0yRo4Qge65FqIQNVYwuwyFicB7hVdeQ1CKWhdo0FtUaEb4Ge+Ggzwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7B7hkrDfVXmz2SvFNkwRPgkbsX8rXgk8lpQh6GeMUkk=; b=juHdf57DB92RMWE4R4VFaNevB4fDUxNO8p93FeyNwMzRZroIyMK95E4l6wSDHFPnXhNDHPnXK6WaA4Ylx5v5gbrwWDAuTDx7afAQToiLXJrC0CipjdbZDfsVeMU86u/2jJP4IF5D8mPz9OnPGXGcQDTDmw6PX4qelCw71Tn8qPU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033623392226.46612683613307; Wed, 21 Apr 2021 12:33:43 -0700 (PDT) Received: from localhost ([::1]:43176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIbW-0006Ug-C1 for importer@patchew.org; Wed, 21 Apr 2021 15:33:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIR5-00041l-1e for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIR1-0005dW-WC for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:54 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-136-cux0jnaGMqG3Fkf-shKeKg-1; Wed, 21 Apr 2021 15:22:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 929B11020C20; Wed, 21 Apr 2021 19:22:41 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id C43A35C1B4; Wed, 21 Apr 2021 19:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7B7hkrDfVXmz2SvFNkwRPgkbsX8rXgk8lpQh6GeMUkk=; b=UclIVKY0OQ2Lk4IL+dLQFV1qlfvAD/b5DSUYS0xtqcMyZB4iZGKpAN4SeqEinZZiqPzf6i oCQLabTWrEmmb3S911spJKe6ne70aunJR521hNCkvnaOF/hAAXrUTavQVF1bKaLkFbQUZ7 LBWW0m9xPpU5mcQVfnuiVOXpz3Xr+jw= X-MC-Unique: cux0jnaGMqG3Fkf-shKeKg-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 7/8] qapi/error: Add type hints Date: Wed, 21 Apr 2021 15:22:32 -0400 Message-Id: <20210421192233.3542904-8-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" No functional change. Note: QAPISourceError's info parameter is Optional[] because schema.py treats the info property of its various classes as Optional to accommodate built-in types, which have no source. See prior commit 'qapi/error: assert QAPISourceInfo is not None'. Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- Random aside: It may appear clunky to have to type __str__, but after I mentioned it on the Python typing SIG list, it was noted that this is actually one of very few magic methods that has a "known" type in advance, so there wasn't much desire to special case the typing for it. Signed-off-by: John Snow --- scripts/qapi/error.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/error.py b/scripts/qapi/error.py index 6723c5a9d9a..e35e4ddb26a 100644 --- a/scripts/qapi/error.py +++ b/scripts/qapi/error.py @@ -17,6 +17,10 @@ parser.py. """ =20 +from typing import Optional + +from .source import QAPISourceInfo + =20 class QAPIError(Exception): """Base class for all exceptions from the QAPI package.""" @@ -24,13 +28,16 @@ class QAPIError(Exception): =20 class QAPISourceError(QAPIError): """Error class for all exceptions identifying a source location.""" - def __init__(self, info, msg, col=3DNone): + def __init__(self, + info: Optional[QAPISourceInfo], + msg: str, + col: Optional[int] =3D None): super().__init__() self.info =3D info self.msg =3D msg self.col =3D col =20 - def __str__(self): + def __str__(self) -> str: assert self.info is not None loc =3D str(self.info) if self.col is not None: --=20 2.30.2 From nobody Thu May 16 00:54:20 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619033393; cv=none; d=zohomail.com; s=zohoarc; b=Oz/UvzZDXL4f2CM91ezfz3PMFCB8+Re3J9//1haVMlGjk1NrmV5M9XlibjaGudcpintnKr+uPbhwSlAXXdutVsV742pOsyAnnBFoDdm5znBzhhIryDthGKYIMatxAZ24B34ew/yoIlWAoJWWpTbwdF272qvxaJ5E3wTXz9oVKxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619033393; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=puwGCK7mHQMv6KhSjdhQPjq8HPu5ifxXwuatn+/3awE=; b=IeAprFj5KIy5BgI1abS/UCZB4INrpwV2TvjR+TPP8T79czQ2cRwmMnF6ysewaE6w3Ha33AvqOGLdVJISM+g3TXzYx9qqyri+dPXRwQbjFI4IKpnMb9KMXBV0qwkXt3+CS66wxrbzc/6awLGo3lRyQff+cjqxWkp43LsX/SAZ//8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1619033393913533.1760232578177; Wed, 21 Apr 2021 12:29:53 -0700 (PDT) Received: from localhost ([::1]:36650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZIXo-0003jl-S8 for importer@patchew.org; Wed, 21 Apr 2021 15:29:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQz-0003p5-4Y for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZIQw-0005Zb-4f for qemu-devel@nongnu.org; Wed, 21 Apr 2021 15:22:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-p0arvmdaMKGIeIBrfgLlPg-1; Wed, 21 Apr 2021 15:22:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 883EB18982A3; Wed, 21 Apr 2021 19:22:42 +0000 (UTC) Received: from scv.redhat.com (ovpn-118-152.rdu2.redhat.com [10.10.118.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id B986D5C1B4; Wed, 21 Apr 2021 19:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619032965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=puwGCK7mHQMv6KhSjdhQPjq8HPu5ifxXwuatn+/3awE=; b=MqmmrUqmlGl9KutuR5bnlKzTMs0eD5rnfoZrkOCMJH6CTvKFVRI9PEr4i6CiQJhEpwCcFB QrgpGKloHonksgxdzhl9rvKpmoMdZGIphl88J2QLmuaqj571QZMNidrJL5nmuF7gDDO/Jz TEwLXtTBWJ8vJxuCWaOVnqrNus6i2NM= X-MC-Unique: p0arvmdaMKGIeIBrfgLlPg-1 From: John Snow To: qemu-devel@nongnu.org, Markus Armbruster Subject: [PATCH v3 8/8] qapi/error.py: enable mypy checks Date: Wed, 21 Apr 2021 15:22:33 -0400 Message-Id: <20210421192233.3542904-9-jsnow@redhat.com> In-Reply-To: <20210421192233.3542904-1-jsnow@redhat.com> References: <20210421192233.3542904-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , John Snow , Eduardo Habkost , Michael Roth , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- (This can be squashed with the previous commit when staged.) Signed-off-by: John Snow --- scripts/qapi/mypy.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/qapi/mypy.ini b/scripts/qapi/mypy.ini index 7797c834328..54ca4483d6d 100644 --- a/scripts/qapi/mypy.ini +++ b/scripts/qapi/mypy.ini @@ -3,11 +3,6 @@ strict =3D True disallow_untyped_calls =3D False python_version =3D 3.6 =20 -[mypy-qapi.error] -disallow_untyped_defs =3D False -disallow_incomplete_defs =3D False -check_untyped_defs =3D False - [mypy-qapi.parser] disallow_untyped_defs =3D False disallow_incomplete_defs =3D False --=20 2.30.2