summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-11-05 11:23:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-25 15:01:21 +0100
commit3794496ef733c58a010be90d29a59ae7147976a6 (patch)
tree75fb6b7a28079477b907030de678ce53731f1bfc
parentbc6a09c36e08d0b1893097e2628459bddcb182e3 (diff)
downloadpoky-3794496ef733c58a010be90d29a59ae7147976a6.tar.gz
poky-3794496ef733c58a010be90d29a59ae7147976a6.tar.bz2
poky-3794496ef733c58a010be90d29a59ae7147976a6.zip
wic: use explicit errno import
os.errno doesn't work in Python 3.7 and shouldn't have ever worked, so use import errno explicitly. (From OE-Core rev: 7b1dba1a464862e35295756ecf52b24d0962528b) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/filemap.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index a72fa09ef5..abbf958b8c 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)