From patchwork Wed Apr 10 13:11:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 162018 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6194920jan; Wed, 10 Apr 2019 06:16:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5jngNRxgcORNdb06558YY6VWGPbnKybhHlqKmotZLlNEoB/CNBwOMUpqDpYwdfz/F8S4B X-Received: by 2002:a62:6504:: with SMTP id z4mr43561202pfb.202.1554902167975; Wed, 10 Apr 2019 06:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554902167; cv=none; d=google.com; s=arc-20160816; b=GGfbS1aGrKCBPK5wXxRIPxpjt6GV7zuIsKZKmxEi4arbh2Wmqh86y1nUzAb1fL8WhK 76mulXsxTfjJ+S73WfQNtCOinjh6EEotoh70YCOten3u5RDHCBaO5C7VclIqLi8NCFpm 3I+1S41AyDtq9aLczGJjGpBOtuhelMSQQliURVgC3j+R8CcoE1jyaSxVKdv2r55tBzFp nBgKy2oPDiRFeKn7Jg46ogaf8XtQ+uLMTu8Yu/JQXMrPk3cic5BoTack4rAn/BfexldB bKnk9tZSgoB4plA76U9DyP5jvGGM/FeWYYenvQRw563jbr3pY9dcF4Qdfxh2TfhZQO2C M4gg== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=BVdXgg/unzuvT4W77UW2piy3Yq8lNOldnl5n5OCxGLA=; b=UVsrAeS1qwCsviPqYLHlnfffEADsxQfhzm/vqv2qcGS6nYczHEUzPjAmZCOYQZTW6l 0rDs7GB5fXLams8LO4vTnRJsEnGEHNTlroB3aIQwAHM1YMHlAnXpFW0kNaUamYBMS2n7 NUoD+YKC1WehD0TtlxodavnCydhpEdoUDizzArN2ztvk2WybL8fGpw2f5dgugqly3Ijk cnKmBcsDYR/B5xoA5MMr/CT3JBxvNy/VS6DhgsZMkJCf3g7deQiV3kmWRIDEQy6O8UPT fYZM5btMsdYgpxZt15k7jfkmw1SFCPwoK4PB5s2WeyJhuOC+HkPeTT8IH+TAREQnJ2b8 Ot5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=rqHe7qhW; 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 v12si32116644pgh.303.2019.04.10.06.16.07; Wed, 10 Apr 2019 06:16:07 -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=rqHe7qhW; 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 ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id AEDA47D9C3; Wed, 10 Apr 2019 13:13:03 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mail.openembedded.org (Postfix) with ESMTP id AE4B67D90B for ; Wed, 10 Apr 2019 13:12:34 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id q16so2561407wmj.3 for ; Wed, 10 Apr 2019 06:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=CtjziQ09FbnC6cKC2MnmjJzxkJuN8uXiJhvJsL873PE=; b=rqHe7qhWNgcAUm2PbjTb/rk0fkwgJGYvy7A7eA+Xkb9K4Pyj9+A5/PQUYxD3ZIt63n YplX73BUYVqmOJ2EzgEh6/8ZQaOFrLK/n9xUqgYWU3xNwBDvlhDRv+G4nVhIlDg6fTrR nmb3wWca0pQws6zTQ8DA9fuwZWLzcryiVYeIXU2n2tApSmbTzJITHUHcsQmb5eF0XMEE Cg6dvyQlK4lsn0zyYl+AMPdZ5dXn3oEdFvaaD6H39MqxbUk9coRYEaF2PUWnJoLA2IL+ w0nZmLv+b55HkL+a6F+rNsFmWNAoy7RUkhcLuJLuwjtvnaamNwuWMTVTsR3zhdws+U6P y1+Q== 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; bh=CtjziQ09FbnC6cKC2MnmjJzxkJuN8uXiJhvJsL873PE=; b=uGOCWbH6ur0JeKEXkBNrg1gKZDuH7LSO6sOFC4C5ApALs7bWPFNQ6Fja7sQJARLo+0 C/owmm7Hop92k9TUgF0HQhmvkYdOwie57UKjQPfmbYQ6Uyn+yDYioV12YqwFV2CPol7K Y1tgzFjh9/1Yp/cW79bN65eEoqcjFppyniSwb0RvKN9bqmwESgxa77rSEwMEiNED3GcZ Uayg1pTUES4/0su/QT7f3VpOdTsmLCsU+HnywODPIei9ObyNb+m1J/HNevt1kT07XXwF p9B9MZH/J2tga6GZj5yCHGQ8+3aZKQcFJ8y+FlSy4MmlU8Ys0YE4Kc/QR+eTmbR4xYzp vlJw== X-Gm-Message-State: APjAAAVq5gMNixoXpFubCmLeL2hzQGsmZivodC5sFfgJyRcww7IcXoif dzFtvnXalXgsyQVtTMCOGJlc1qsdEBo= X-Received: by 2002:a05:600c:21d3:: with SMTP id x19mr2873307wmj.2.1554901955112; Wed, 10 Apr 2019 06:12:35 -0700 (PDT) Received: from localhost.localdomain ([37.205.61.202]) by smtp.gmail.com with ESMTPSA id x14sm3032399wmj.3.2019.04.10.06.12.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Apr 2019 06:12:34 -0700 (PDT) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Wed, 10 Apr 2019 18:41:48 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [PATCH 29/33] 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 From: Khem Raj - 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 Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster --- meta/lib/oe/maketype.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 -- _______________________________________________ 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 f88981d..c36e7b5 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)