From patchwork Wed Aug 8 22:49:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 143635 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1366585ljj; Wed, 8 Aug 2018 15:49:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwgJSV885jFllso9TCWQnRfeoIhlHYzzYLgPYTckAWo8tPAmYhdWW3BPmLZWj4GByD+2HiT X-Received: by 2002:a63:db15:: with SMTP id e21-v6mr1565842pgg.418.1533768573765; Wed, 08 Aug 2018 15:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533768573; cv=none; d=google.com; s=arc-20160816; b=DurkxLZ5Ugj0mkBt1cvxK+MoD/vJOP+IT03vO2BxaFg+FIn8tFTD+mkuS5KfeEcfKM BRCoQrdj7a3DQWJkMT/yA3QD+JULENueBkqPgbhFPgtxTqQmVFKBUXCajxZTOqJch4PN EIwHZO2j5avhiqmzhyLbzApTgKOtvEKKbPVPLRX1EJmg26xqFZAX4jwXtWJoY0bi5fOD CG+XldbI94oxTvM/H+RgalMO8MCUKtYYcXxjuwsip5F+5PHVIKyDg1Fi00myu2L143AV 7LrZKlX20OEHw18YZCW3XQUEk+hPQGr7rtrlsRtZ6JUG+6G5MDd/rdrfhlIjHAcc8N0L hRQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=KN0qzFtpwNKozrTzUtZzseMZsqXDjK981leR156QOrc=; b=qkJjNixeBT0OQKbsPCioc+BN3TCr/U9V9H08GjGduEY05j3a1yAufvrQdxoE7uQut0 9fryeTJJb5rypA5XtMjsjNBJgtWOICs2TvLXTBSpMPO5E4JefjOuvGbCnpLlLog3gVv7 ZKweou3ULRM/KxX/OaEQiv9AjXDB+DzBpT19E8n5KoWQM9GGVsLurh7ip4H7cbAPOrPf sktYVQMAGYJIxhxQPlNHN4B7RU2TA7s5xo3+7tioCmDLlfC/eoZWD5Wri1QKRy0fzFxW 3Kn9CfEbbrM43oWgN67gL+c2YWccqukxI5JnQAGnUG6Qq+AR/SiviLFqEtkBnnbhIVgM iIYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=qQmEVbCg; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id j20-v6si5148273pgl.594.2018.08.08.15.49.33; Wed, 08 Aug 2018 15:49:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=qQmEVbCg; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 5ACC478D99; Wed, 8 Aug 2018 22:49:28 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by mail.openembedded.org (Postfix) with ESMTP id 8688B78BF6 for ; Wed, 8 Aug 2018 22:49:27 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id f1-v6so1748702pgq.12 for ; Wed, 08 Aug 2018 15:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9evr431z/NALx74C2NkDsQvdGiDuEnPXJHbPmwtts/Q=; b=qQmEVbCgjdtFmQF8nLyFdM7YSqA9eBoIwkVvNln4Jje1dgngXMWpc5DzCWdXNzOQvz XCD97vHRJ/L4yl8DstZc/W4A+9pXrvhiB9YGLd+xhxapZl7Jem7zs0icVDQimlLob2Vb nOsWM26Z79Eklbh7FZmjdG706iXTBiuQ77p0mm77NAX1tnGbWJ5DDwH6TX3s9q+u0RUi ovB/BrtWz73vmAMtTvpW6pllm8Y8gFLvs+ZDhhqLhJM2giGeFyK6mvj0UfUBT+uhBhtQ r6g/i5IGnC8MrM6SueyBa83yFIhJJ3u819WjzAWcnutV/QWqmTVMHWCCeVKgX6VXtaOk lr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9evr431z/NALx74C2NkDsQvdGiDuEnPXJHbPmwtts/Q=; b=AWOx5+yWiwWY9cpr7/JDjAj/yWqXfyds8dO32ymFOLCNi08EMnunl5ZpF4iSpJBN/2 sQ71iJkgpDxVvBfh8LkUV3rJ9wBZpe7IKK/q8WtknsA+QVRIc6gsuZgCg6LeIqkuKdIS +Jo1fr7AC9YzULdgxdVtV3Z4X0dNsOp78hIvwIV46Rb9FKLBSnWjyDMMMEchnCBUCo0+ JbPc3BVLiQj2aj7jPFxa+AXsAX9c3zFxUdcbZBA56xskhAI/p41QJHffczoORaPPizaj Hw3StOvF2Hh95scqfq+PI3Ym6zpj5thoyf/zvPNzFEVjPQO/h6a6XXURI+kDJOdjSv/D HP/w== X-Gm-Message-State: AOUpUlGoaR3+2aV5XTNo2YsD271zcmbCma/ihv7FC7e7gijB1i9UXHPV 6GpL9ETwEKoX+3llKrJPeXBaKzvY X-Received: by 2002:a62:a6db:: with SMTP id r88-v6mr4873622pfl.60.1533768568253; Wed, 08 Aug 2018 15:49:28 -0700 (PDT) Received: from localhost.localdomain ([2601:646:877f:9499::1d00]) by smtp.gmail.com with ESMTPSA id s195-v6sm15226452pgs.76.2018.08.08.15.49.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 15:49:27 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Wed, 8 Aug 2018 15:49:13 -0700 Message-Id: <20180808224913.23196-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.18.0 Subject: [OE-core] [PATCH] lib/oe: Fix collections ABCs DeprecationWarning in Python 3.7+ X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org - Prefer collections.abc (new in Python 3.3) over collections for abstract base classes - In Python 3.8, the abstract base classes in collections.abc will no longer be exposed in the regular collections module. This will help create a clearer distinction between the concrete classes and the abstract base classes." - https://docs.python.org/3.7/whatsnew/3.7.html#deprecated - see https://github.com/python/cpython/commit/c66f9f8d3909f588c251957d499599a1680e2320 Signed-off-by: Khem Raj --- meta/lib/oe/maketype.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.18.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oe/maketype.py b/meta/lib/oe/maketype.py index f88981dd90..c36e7b5604 100644 --- a/meta/lib/oe/maketype.py +++ b/meta/lib/oe/maketype.py @@ -7,7 +7,12 @@ the arguments of the type's factory for details. import inspect import oe.types as types -import collections +try: + # Python 3.7+ + from collections.abc import Callable +except ImportError: + # Python < 3.7 + from collections import Callable available_types = {} @@ -96,7 +101,7 @@ for name in dir(types): continue obj = getattr(types, name) - if not isinstance(obj, collections.Callable): + if not isinstance(obj, Callable): continue register(name, obj)