From patchwork Mon Mar 30 13:36:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1263949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tNnlXawQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48rYRs0mHXz9sRN for ; Tue, 31 Mar 2020 00:37:44 +1100 (AEDT) Received: from localhost ([::1]:50056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIubm-0004R9-8h for incoming@patchwork.ozlabs.org; Mon, 30 Mar 2020 09:37:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49479) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIub2-0004P5-MD for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIub1-00019X-CF for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:56 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:42090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIub1-00017M-6G for qemu-devel@nongnu.org; Mon, 30 Mar 2020 09:36:55 -0400 Received: by mail-wr1-x431.google.com with SMTP id h15so21634380wrx.9 for ; Mon, 30 Mar 2020 06:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8Wj6cmPD0bD0MBYEZwMRUoxGz/ny5iBWvlp9JF8e2Ro=; b=tNnlXawQLbjcI51+4CWmIFK6SnKx4Kz/PwHCv1ccMmgbiMNZweaWpdaBhl/AK+2IdW lb3xupZd4I52NEvapfp+SkMJORhpt8a1jeNS5Zj453nyw9kSeIS/Usdqr9X5cwd7FS7X +XL6bkEt69w5urgGYLgyoaKdHIP7fbaFmCTATUZ9Wn5XhvHMRFvb0rhwQAw0Y7LZcS1I cRqb7v+WxgCvD7I4fh8JzlFQa90rP1lGfB2TmFM84MHujcN4+2CH1i9HrBtoEEi8fjeK VjzJwh9DwjBQjdQ8tWhmoo9aXEmOX2ZgZ+kTjuyJPePcqBc+nCqjJc7uPu8xbnLuhVN7 Q1pQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=8Wj6cmPD0bD0MBYEZwMRUoxGz/ny5iBWvlp9JF8e2Ro=; b=OoROX+4abKEUb+IE0bWZrLxPQZqbQAxAef7YIVAsYpsqtq7ZXevSQ6F3OUbFNyMzyy Rl2bhMjIx1BWMJBv2Fxc2knILXgD8U9OU5URzPEm305WsZIt1gxMfDvzyGXG3eAtXqRJ 01W5AOOIz/v8h2VmKHcOOYMmPrCh4XAO0Y7aXBovQ1/7FtggWU6FpoA/cS0EcSnTV6gp pNQWfbJS7asps/coqRwlT+uwYRpJw53CBjkEBq+4JAzzA2hDr7TdBeJye/Y1Ij+y/pZs Ilav1KswT1AopRgxI6LldwhZJu1+xdLs+pUBtiv8ZcCo/zwbpwItzjC2IXBlbfnFB18a w/lA== X-Gm-Message-State: ANhLgQ1u7oi+ltRwAbH/IHBI2eJQYPwyTTUt+z0D1aWlgFoscJfwwNNc iz8qL/SceyAWGiwh1knZjrMatVT/aGnYow== X-Google-Smtp-Source: ADFU+vsDW0uMapJpkdBFIctmCGWTqo9B3c4AiazDAXYWGlJE0Cm4QeK/P1cBpOGdUs/qOsQ5/u6UDQ== X-Received: by 2002:a5d:4687:: with SMTP id u7mr14658575wrq.62.1585575413812; Mon, 30 Mar 2020 06:36:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o14sm20756504wmh.22.2020.03.30.06.36.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 06:36:53 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/6] docs/conf.py: Raise ConfigError for bad Sphinx Python version Date: Mon, 30 Mar 2020 14:36:45 +0100 Message-Id: <20200330133648.22297-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200330133648.22297-1-peter.maydell@linaro.org> References: <20200330133648.22297-1-peter.maydell@linaro.org> 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::431 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+incoming=patchwork.ozlabs.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 Reviewed-by: John Snow Message-id: 20200313163616.30674-1-peter.maydell@linaro.org --- docs/conf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index af55f506d5d..7768611e89c 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;