Received: by 10.223.185.116 with SMTP id b49csp8832320wrg; Fri, 2 Mar 2018 08:41:33 -0800 (PST) X-Google-Smtp-Source: AG47ELu7oFyqI/bCo8yj9bZf5t8MBqCtsWABsL3VDilddG7yQ3MCi2etdw+kQORhsD0v5N5wjeSo X-Received: by 10.98.224.65 with SMTP id f62mr6241933pfh.191.1520008892918; Fri, 02 Mar 2018 08:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520008892; cv=none; d=google.com; s=arc-20160816; b=FoI9Q3FZfL8El7xxBKFcOo8xTDEaJmfxL4cmtLhszqc+FdpxVw9uxELViiAlIGTSar rHf7sHQSo3z11rOLgJNaT4SQV+LVBfN7OhuYQLI+CmnPLy0lVu7OFgyDH9wKTTFcHeAm tLLqJNoW3YcY1VdzzFkUg7s5IGpZP8TgSM3NkQAjBpivLivasKyOhbaYBjJEw2xCcgpN miKDs+eCZzMUF5aOe2APsFRDPfCcUu9nXG/koiQgnrm3HgKg3Ki7UScpoYUBBhYqC0XL 0s4S4uMNVzE9DLuQTEjFg4TUGVNobnG7hLjhoMs2M/ra4kfUL7r78vzStiYiwSBDseen BAMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VBPCmx1ZBaU+F2+Weutn/iX0QHUliNEYuuFfPH15M6M=; b=mnaQjpsKIA6rduqWqucWRT5U0o6cBoMTzWL5EsWBQrxyeXaiGdccoFfZnefW3+XHI5 syeGzBc9npty4RKoR038Hn2VsP0DQ48n/lu+s3sXzYdnqeR0RLxp7JRnI/3I5nSPXhSU /cfGylfRIJds+dPqcGWZtGPPMjbhpTyryP04p3OmlCo1fLzqEI9dw8SPTILkL6HAduq1 AiIXbBasEBC0oaVtN0dbvWd8tHb2uG3MwFaiqQ8CBTMPKREpjkK9RodxwB94vNdpwkro AcDNW/XRtMvX620tEgrYrSNVWYYhrpCvk+YCL5odb/iLhm7GlX17KJdzlpJsMOKaVRtr dKNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DJXbe6B+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y131si5114769pfg.44.2018.03.02.08.41.18; Fri, 02 Mar 2018 08:41:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DJXbe6B+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936622AbeCBQem (ORCPT + 99 others); Fri, 2 Mar 2018 11:34:42 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:52464 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936591AbeCBQeQ (ORCPT ); Fri, 2 Mar 2018 11:34:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VBPCmx1ZBaU+F2+Weutn/iX0QHUliNEYuuFfPH15M6M=; b=DJXbe6B+gsogpmXm5NJRIRRN8 oOTAVUpr74KzKzLEdg3Yy7sm1C3fxKXJIdkD2UYMzb39R+qDmOmNLMETfbdE+P2OIaKNiq8eIUCPW syuMlBxYPx+V07QJrSSHsTQyqKBN0xU+C7/zOlTEEijCNfV+KFf6gQx+tToIgPy9k5pwNXF8u6zd8 C62dfFfPsatsNHihbzpQ/lfMCrs//DgO8Jd1RfqT/Z/VQIvmMq/OvVQtLsh2jrgZT5sSmn1JLj/I1 dkAOdtKnSDee9QwyYVBix3+wN2hdXI+pIjT+b2zrBlKMEGLRGgn9dBgU7Pv/BY8jD8AVZ0UiaHEW6 V1vuTTeJA==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1erndM-0008Ke-Dn; Fri, 02 Mar 2018 16:34:12 +0000 Date: Fri, 2 Mar 2018 08:34:12 -0800 From: Matthew Wilcox To: Takashi Iwai Cc: Jonathan Corbet , Jani Nikula , Jiri Slaby , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Documentation/sphinx: Fix Directive import error Message-ID: <20180302163412.GA31400@bombadil.infradead.org> References: <20180302152831.11510-1-tiwai@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180302152831.11510-1-tiwai@suse.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 04:28:31PM +0100, Takashi Iwai wrote: > from docutils.parsers.rst import directives > -from sphinx.util.compat import Directive > +try: > + from docutils.parsers.rst import directives, Directive We also don't need 'directives' on this line as it was imported on the previous line. > +except ImportError: > + from sphinx.util.compat import Directive > from sphinx.ext.autodoc import AutodocReporter > > __version__ = '1.0' Here's what I tested on Debian: +++ b/Documentation/sphinx/kerneldoc.py @@ -37,7 +37,10 @@ import glob from docutils import nodes, statemachine from docutils.statemachine import ViewList from docutils.parsers.rst import directives -from sphinx.util.compat import Directive +try: + from docutils.parsers.rst import Directive +except ImportError: + from sphinx.util.compat import Directive from sphinx.ext.autodoc import AutodocReporter __version__ = '1.0'