From patchwork Sun May 1 20:15:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 617275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qydwz0YQGz9t5V for ; Mon, 2 May 2016 06:16:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4F8B18B868; Sun, 1 May 2016 20:16:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KVdwpsZdRQbB; Sun, 1 May 2016 20:15:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9B3AF8B926; Sun, 1 May 2016 20:15:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 42A491C0FD0 for ; Sun, 1 May 2016 20:15:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3F31D8B1EA for ; Sun, 1 May 2016 20:15:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FR60wTZZ2uh9 for ; Sun, 1 May 2016 20:15:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by hemlock.osuosl.org (Postfix) with ESMTP id 81C858B1E4 for ; Sun, 1 May 2016 20:15:29 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 832C9482; Sun, 1 May 2016 22:15:28 +0200 (CEST) Received: from localhost (LFbn-1-6691-76.w90-120.abo.wanadoo.fr [90.120.129.76]) by mail.free-electrons.com (Postfix) with ESMTPSA id 45053141; Sun, 1 May 2016 22:15:28 +0200 (CEST) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , Samuel Martin , Yegor Yefremov , Gustavo Zacarias Date: Sun, 1 May 2016 22:15:18 +0200 Message-Id: <1462133720-409-8-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462133720-409-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1462133720-409-1-git-send-email-thomas.petazzoni@free-electrons.com> Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH v3 7/9] python-pexpect: fix byte-compilation with Python 2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" pexpect contains one file, async.py, that is only meant to be used with Python 3. Due to this, it fails to byte-compile with Python 2, which will become a problem once we make byte-compilation failures fatal failures that abort the build. As suggested by upstream at https://github.com/pexpect/pexpect/issues/290, we simply remove the problematic file when building with Python 2. Signed-off-by: Thomas Petazzoni Reviewed-by: Samuel Martin --- package/python-pexpect/python-pexpect.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package/python-pexpect/python-pexpect.mk b/package/python-pexpect/python-pexpect.mk index b74bf83..40a1741 100644 --- a/package/python-pexpect/python-pexpect.mk +++ b/package/python-pexpect/python-pexpect.mk @@ -11,4 +11,14 @@ PYTHON_PEXPECT_LICENSE = ISC PYTHON_PEXPECT_LICENSE_FILES = LICENSE PYTHON_PEXPECT_SETUP_TYPE = distutils +# async.py is not usable with Python 2, and removing is the solution +# recommended by upstream: +# https://github.com/pexpect/pexpect/issues/290 +ifeq ($(BR2_PACKAGE_PYTHON),y) +define PYTHON_PEXPECT_REMOVE_ASYNC_PY + $(RM) $(@D)/pexpect/async.py +endef +PYTHON_PEXPECT_POST_PATCH_HOOKS += PYTHON_PEXPECT_REMOVE_ASYNC_PY +endif + $(eval $(python-package))