From patchwork Fri Mar 13 16:36:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 184551 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2091421ile; Fri, 13 Mar 2020 09:37:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu6xGf5ExUNI4QmdsFZBgRSfvWJFIlWEL9BazOvjfvG5Ob8sVwyibh2ZVw3nldfd3O5R7sz X-Received: by 2002:ad4:404f:: with SMTP id r15mr11618148qvp.128.1584117469349; Fri, 13 Mar 2020 09:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584117469; cv=none; d=google.com; s=arc-20160816; b=QNt+KuAgVOL8/ZkKlzAn3U+5Ill9hrUyYSQHoIGz51MJcbYY+JpAIIJWWQmYwjPfYE CRragum30WVCvhid8aLpScHwJs2ba5AIA+JjPqHCk9tHNiwDx3ZDDWOPae+3KqVFF/vI G8dNOvjI7aT1053hzptLOFgUEYpFELVXdOJSodL6qvrDGmr1XVQWXOe/J9FvymUEwjEc iMkDgDgB2hIA9HZ/P/WzRo7ldf0FjjCVxHLzm0eUJhrTGZQSa1u+JKCRpk1fCrBymH06 hq1v6Fy311VGf7iJwqY32ZC4uu3rfyiFjL2VV0VTq+AFys68OyzyZXEq1OmDJLYgQbiX p/Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=PjPArpij9CHiSdkRHfeUwTYaHoGk21oZ1d/rkTCBO/k=; b=EKppU+GoFF/QpuGCfXs8m/qLtT58LJ2MP3RDHOsOpeAWsEjWTIBcQec2XKvPlLRsMl HTxZbqEp0cXaqO2WFUa2n/Rf2prwNPomUKge2IXJAdr0Z76I8M5YbTgTb1+zlGRSA+2/ 9/jY62L7ZkgqDMQyLzX4U4W3Uph/x+N3w7W33jPqLMA5/DtaFIGx+bdzhr2kbZQPud2i lSfAjteQvjwAj7Vhf+AaDTIuXO+jqq5ctDbnjpQtwpN4Uue9/JtCjfPQcoceCEGq+4Tk gltNlW4PCHiqb85whYLQu5tsC+KILYsjiOAM2UPTmM5SczHRnGXs4Ywcz8uaTA5gOGxI QyFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o2mHRIr3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s8si3486751qvb.42.2020.03.13.09.37.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Mar 2020 09:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o2mHRIr3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCnJk-00055L-UI for patch@linaro.org; Fri, 13 Mar 2020 12:37:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36549) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCnIM-0002Vy-R8 for qemu-devel@nongnu.org; Fri, 13 Mar 2020 12:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCnIL-00028W-Gd for qemu-devel@nongnu.org; Fri, 13 Mar 2020 12:36:22 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:51500) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCnIL-00025I-9O for qemu-devel@nongnu.org; Fri, 13 Mar 2020 12:36:21 -0400 Received: by mail-wm1-x32a.google.com with SMTP id a132so10703112wme.1 for ; Fri, 13 Mar 2020 09:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PjPArpij9CHiSdkRHfeUwTYaHoGk21oZ1d/rkTCBO/k=; b=o2mHRIr3Z9240oZZXcmfkkYVA5+CUvcofcMeIrZGZVXLb9s0vUvvXW9HJsfwpg+psT 62Y1OS9yjvFkhxmcMxcIGh/CxQbzui0HIEt+OQDrD/pTefoRxVlcrFt/woqmgT1nEdS9 /5qDnOp95B+XrSa/OMNW8PCerso73ohzKtMWhBGvYIAaj+QUaV65UqcOgQyt9pmJ0W3U W7i3CxbCt/p/iiU7rvkzZ2by7iTRphNN5MSaks3lV7CuZ3EjFwKaobErwSStldNbeMar omHQqeH7UxoqmhetNYnGC+YHuUhMJ2dX828pemg85GUN9ADKUBhK+abOSFG8IJ2FxEbd Wvrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PjPArpij9CHiSdkRHfeUwTYaHoGk21oZ1d/rkTCBO/k=; b=WXgvMXWXsJXLchXX2s3VrGIlVFqcp/srznG5dlvTUhxvzkl99TfLLGpXCYRVgDdGIw MqoVrvqPkWQ/xUf13zaE232khiCDfNZcF4xWEYTMZTWvhbgs2rHVDsZC1iXlj/+51EJZ BWECN8LSYXuAYbqBSS6D78qUFHueXsSsk5EZLA1wGC2IefjawgwbSfPRK3vFywkoURzr s/DnjXlj2Lys2Us6xagNZHe8VnFe2OuofJpTnsOnxZmmC8B4Z8tPaDGfRV8bJ84viRSm g8An8OCc+Yxv52cyNwCOvoNTzm0VwamBxxajq+oprPiDqpsgHJq4T8FLZRc56ev+RMuV ebtw== X-Gm-Message-State: ANhLgQ0C0y3ncwWexmWswHHLVubC/SfevmjFaILaJs0JPA//esAlgs4l P6dzR6Im0Spr6DbzzZ7vxrRZfYi5/ytiQg== X-Received: by 2002:a1c:ac88:: with SMTP id v130mr7755493wme.34.1584117378392; Fri, 13 Mar 2020 09:36:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id z19sm18210993wma.41.2020.03.13.09.36.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 09:36:17 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH] docs/conf.py: Raise ConfigError for bad Sphinx Python version Date: Fri, 13 Mar 2020 16:36:16 +0000 Message-Id: <20200313163616.30674-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Raise ConfigError rather than VersionRequirementError when we detect that the Python being used by Sphinx is too old. Currently the way we flag the Python version problem up to the user causes Sphinx to print an unnecessary Python stack trace as well as the information about the problem; in most versions of Sphinx this is unavoidable. The upstream Sphinx developers kindly added a feature to allow conf.py to report errors to the user without the backtrace: https://github.com/sphinx-doc/sphinx/commit/be608ca2313fc08eb842f3dc19d0f5d2d8227d08 but the exception type they chose for this was ConfigError. Switch to ConfigError, which won't make any difference with currently deployed Sphinx versions, but will be prettier one day when the user is using a Sphinx version with the new feature. Signed-off-by: Peter Maydell --- I don't think that commit is in a released Sphinx yet. --- docs/conf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: John Snow diff --git a/docs/conf.py b/docs/conf.py index 960043cb860..87b5f07f589 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,14 +29,15 @@ import os import sys import sphinx -from sphinx.errors import VersionRequirementError +from sphinx.errors import ConfigError # Make Sphinx fail cleanly if using an old Python, rather than obscurely # failing because some code in one of our extensions doesn't work there. -# Unfortunately this doesn't display very neatly (there's an unavoidable -# Python backtrace) but at least the information gets printed... +# In newer versions of Sphinx this will display nicely; in older versions +# Sphinx will also produce a Python backtrace but at least the information +# gets printed... if sys.version_info < (3,5): - raise VersionRequirementError( + raise ConfigError( "QEMU requires a Sphinx that uses Python 3.5 or better\n") # The per-manual conf.py will set qemu_docdir for a single-manual build;