From patchwork Wed Apr 10 13:11:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 162017 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6194787jan; Wed, 10 Apr 2019 06:16:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8eTpXeVZJNES7TwY7kswJoPyf7OYUyFcUG8TGVTLFaSzOk97N/LrD3AgolUsqVjf8KNf4 X-Received: by 2002:a65:625a:: with SMTP id q26mr41485907pgv.68.1554902161261; Wed, 10 Apr 2019 06:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554902161; cv=none; d=google.com; s=arc-20160816; b=SLu2Wqpe3rAcW4Yg8V0qE6YH79krQCrf+NKAy6mQfvImFAFDCOFdSsSLuueRHc4TAV 9PtxU8qIdnE/SJU+6sIWv5PBqQrBfE/iwHblGvl1Dz6oJbUdavtpKPJIMbffdv6WXJ+D Y1A2H/nncO7mqQB6Fbk90ANjBU6AmVpFYy90XuvEkQVRmM2WuQEITl8ahO7ZRW+Mn3xN qQvHqAH0E6MJetZvq+t2yX/TVvsRZp/8SNF9Lz/ojKzieQjcPngY9d/ylKv++dyx/8a0 8+5UNS2kaN3+7F9tJ8uVizlwAGozjctsbdxceWvPPjOWP9l+o8fgrY9PbPnPoVmd4D45 ucfg== 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=pzEDSJnFNHmE7iGp//QQwiP/0KdIoJB3o0fHBEQumdI=; b=oxrwoSjn7mvGEoRI7GAgZodbtxHPAzMyxuhVquIFMQx8yjxX48RHOErs0CSxyUNrnZ sNFQF+W+v2VtXfaO4qphumlnTxBjuSd5iQHEDZXp8vhZ02IAyl/agEnfaPeBSaHQa+k1 7tF+B4pfJuiJZwvtw3A8gDdKkWwKew/cCwI2b7j0Ic8Uo5/khmI8N5HRIFxKTNFlDg9C 95oICDEsCABbWZ6NZdM4CTiCTLYu5TOnXBn1Nzp7OG3YaRMNs0HdKH9g4zeFuNnyooZZ BVazJ1jB4ie/TMHI5d3BJjvsLQje/mcY/rMrAcYvOqIy7580G1sPHad0sgrN8L7to+wT WMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=t1zehSc5; 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 g3si30892729plq.400.2019.04.10.06.16.01; Wed, 10 Apr 2019 06:16:01 -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=t1zehSc5; 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 818537D9BD; Wed, 10 Apr 2019 13:13:02 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mail.openembedded.org (Postfix) with ESMTP id B9DC37D925 for ; Wed, 10 Apr 2019 13:12:33 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id h4so2877074wre.7 for ; Wed, 10 Apr 2019 06:12:35 -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=936Vz3zbrcn0BnOLj4I6dW5O+qt8/8XPllhLqAxdpNA=; b=t1zehSc56AHHDQOv18Alf/m+i28wnn5X9nCsTIrvQBcdCp2f5X0EOqOxI+yRWJiMXE jWYn0iyMuVpTPCNbGvrr0RiTa/+boCBaZuonb9DCrr0M9x1pT6xaLy1+5mZADylft61k Uqgiu/tpFZnZ9vxd0ZU1FPpjfmsqE3vxiA33kiiLyGXWuZC6WYcJth2ieus6p5GfVN1Z 2Wd24n2WCR1rNsgejrFWTaEy0FIhU/wt1WbPl6TRQvAzfIkPhYyGp97X5oGTamR+VPg7 +SJaAhI5BBQ3T+47EFvkMt5OZNrSwWEAtGls42wuD437+9kLIbimEwdQZ78OOWTmZdFm KeVw== 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=936Vz3zbrcn0BnOLj4I6dW5O+qt8/8XPllhLqAxdpNA=; b=CSaBLaIejYA5gX1gpWubZ6ocL9MUgVwRB237g7UcZlBQiUtseKp+hw0KdF+t5Jts0C 6g1A0MX4IIZCIcwprz18sV/5buGyav+gs/N4xRy468l+oQRCVCE7D8W5x94XbkNjcvDD k9IvZgMIjVFxZ50uhL2FyllHDU350itLm2YM/XYRGjFQm5UJMnPdHV46g71i7g2t2ml2 ZloAh2YjfaiYekisft4bGspcOlw2IueZrlarKQyf67Ox63x2g9EdPRXg+mC8c6kwqg5U 5VtaGBj8Dw931/kzfI2Mea03p+iCvCClOpL1LI+8HuHSkcVaJxCLVpE/uN8kdYS9l221 BwZg== X-Gm-Message-State: APjAAAV5/Pskx87LKnkTLS37NPDgb+L6ng0Ey1KPXpjPC0EK5iaOwnWa 9VYBiV/HkAr5iYn39rAwczaMPDhv45U= X-Received: by 2002:a5d:6101:: with SMTP id v1mr5963597wrt.222.1554901954193; Wed, 10 Apr 2019 06:12:34 -0700 (PDT) Received: from localhost.localdomain ([37.205.61.202]) by smtp.gmail.com with ESMTPSA id x14sm3032399wmj.3.2019.04.10.06.12.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Apr 2019 06:12:33 -0700 (PDT) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Wed, 10 Apr 2019 18:41:47 +0530 Message-Id: <7b1dba1a464862e35295756ecf52b24d0962528b.1554901639.git.akuster808@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [PATCH 28/33] wic: use explicit errno import 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: Ross Burton os.errno doesn't work in Python 3.7 and shouldn't have ever worked, so use import errno explicitly. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster --- scripts/lib/wic/filemap.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index a72fa09..abbf958 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py @@ -22,6 +22,7 @@ and returns an instance of the class. # * Too many instance attributes (R0902) # pylint: disable=R0902 +import errno import os import struct import array @@ -189,9 +190,9 @@ def _lseek(file_obj, offset, whence): except OSError as err: # The 'lseek' system call returns the ENXIO if there is no data or # hole starting from the specified offset. - if err.errno == os.errno.ENXIO: + if err.errno == errno.ENXIO: return -1 - elif err.errno == os.errno.EINVAL: + elif err.errno == errno.EINVAL: raise ErrorNotSupp("the kernel or file-system does not support " "\"SEEK_HOLE\" and \"SEEK_DATA\"") else: @@ -394,12 +395,12 @@ class FilemapFiemap(_FilemapBase): except IOError as err: # Note, the FIEMAP ioctl is supported by the Linux kernel starting # from version 2.6.28 (year 2008). - if err.errno == os.errno.EOPNOTSUPP: + if err.errno == errno.EOPNOTSUPP: errstr = "FilemapFiemap: the FIEMAP ioctl is not supported " \ "by the file-system" self._log.debug(errstr) raise ErrorNotSupp(errstr) - if err.errno == os.errno.ENOTTY: + if err.errno == errno.ENOTTY: errstr = "FilemapFiemap: the FIEMAP ioctl is not supported " \ "by the kernel" self._log.debug(errstr) 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)