From patchwork Mon Nov 5 11:23:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 150169 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2475864ljp; Mon, 5 Nov 2018 03:23:30 -0800 (PST) X-Google-Smtp-Source: AJdET5eZfzrBeymupO9CuPzDtEKycfRB/tdizIzXE+cyZseXEbpUKzk+M/TtUOb3FtUEdL/OSvTX X-Received: by 2002:a63:7c13:: with SMTP id x19mr19562684pgc.45.1541417010699; Mon, 05 Nov 2018 03:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541417010; cv=none; d=google.com; s=arc-20160816; b=aJ35oBjO/stP8YrOiTaB1drOYkzreRYEtguwmIKquBUY19uIWMAjA2hQVua4JznrAI OkFwHUZDa+B7A7iqKShXpmoZA8RjPWwcYruF7v/d0kc5F8Gx+QWnVDyoN9IShKgX//uq j/W/Gv3HwqwcLrLtK2++asAW5lJjn7F6m9jvW8uFhMDn4JeOT6ZrDQFYPjtmJ9FhCe/e lRJ22nTSJnKNpZsyKqTRm4zhPN3TlJVfRw2f6JBIc4xlmxqBXdMpHSVZbUrKWTxd8B+A vL1CYtTyhP/YKq7EXPDjWQNuve9w6wU3WDKbog20CBGdSwDV84wwPtmkH0mtlw231lL0 JdXg== 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; bh=i6QZzhY6wFpCGgYkTEjDtpl4Ytv4z7m0EZ01rFLIHyA=; b=AEVgGPDPdm9RlLRHUbPax1zeSVS7BgsezWLq32gaOjmC/O5Y6yPwrcTkvjMFPxxTb7 nphBVK6K4gfuzJVuNnbSiF4AE7Fzgu4jYCYHBSS0sEKOMvOP+NV2M4nmKIwfvqNP3IAc IfpGb2o/ostVJSnkKq9Jh8bQQO389hqur5PrJ/S18Nd2l/X8ALgbcMKTuaT5JQyOqp2u enrItGpdPh71mEIg06NcgRCJnHgUPX6KEnREzeaafxm9a1ZErXWCh6p5fEAm5NfRlfMQ doY66fKhr2JOJySmuwIQe2NJduLUPuoCvLx0kSftpjjJ9lrGRV5FDqz/rWRhI6CgxC+N NStw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=sCHDDDlL; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id z7-v6si43802582pgi.178.2018.11.05.03.23.30; Mon, 05 Nov 2018 03:23:30 -0800 (PST) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=sCHDDDlL; 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=NONE dis=NONE) header.from=intel.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 27DA379EED; Mon, 5 Nov 2018 11:23:28 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mail.openembedded.org (Postfix) with ESMTP id 6E36A79EB6 for ; Mon, 5 Nov 2018 11:23:05 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id y3-v6so8760698wrh.10 for ; Mon, 05 Nov 2018 03:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=To426eYdVOSKVMGcHF4fjf9WpjptKaN+e5vD9mifpMc=; b=sCHDDDlLyv38BQMQy9F/tznVohr50i6aNnCH/CPLWWLmOond7KGNGCaYM0mbQ+4p3E WgKuyIO+RZwRtOyRj7f3xmZghUfbmP+dkqw27ZGFLyhkh6GrAiLMVPEHHF0W2H/Cfc0K dZpoVJAG8/nwAyK3IuZk4w/aodmaOQpY+RQgH4S2Ob11eAvCMxWT6qHNx6GaWdJWdzSL j/Sctc1Ej7UC5/14WxBEqSOFooSGBV1yhq2iCJoZd/wRNNMJh8xn21YW3Ql9vXQI60j8 mh4AB+Ok6FL/EyXaYQHKb/d6810il0WJriGC7cVxo+4/d4VG2+aPozFAvKZWqlXQCuEj Y0tg== 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; bh=To426eYdVOSKVMGcHF4fjf9WpjptKaN+e5vD9mifpMc=; b=k3XC3LlbfMb9GGfjLveAcwul/mn9yOVMo2PjJGWGKUo00vZ0bRxX9h8kKW67BXnVPa AFmeu64jfBXDsHDkq4WooNAHrucFl16op+9k7h9d27iYajlOWpvlLZkIie01ahTPBFIf c5lrFcOdjr8URKCNSmNH61aWTGmYJSHDzTlF7IBxiJPHLAED1GFhlsnpq5yH+o2TjpSS rCA++UX1/NRcJl5+E2TD561K60pt4ie7DamokQIKRuyQPY4JVMKU3zdocjzoqTZlvuQ3 d0KpoTLxyu49jcR1ckfEMOGiTKvaYjbyj6xs5RtJKEt1iqfS5S1EF0r+vmfZ/V+I5Rw2 Q3oA== X-Gm-Message-State: AGRZ1gJOb61WiF+ekZwoS9T/4b8Ayhd9NUKbRlMaLzXJDmD+6bqjWJ11 1k7+J/vm/onHfq1xXm8tnHQRgoG4pLo= X-Received: by 2002:a5d:4a91:: with SMTP id o17-v6mr6225218wrq.132.1541416985808; Mon, 05 Nov 2018 03:23:05 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 125-v6sm33352869wmy.32.2018.11.05.03.23.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 03:23:05 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Mon, 5 Nov 2018 11:23:03 +0000 Message-Id: <20181105112303.9212-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] 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 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 --- scripts/lib/wic/filemap.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.11.0 -- _______________________________________________ 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 a72fa09ef55..abbf958b8c8 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)