aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2019-09-04 07:36:59 +0000
committerArmin Kuster <akuster808@gmail.com>2019-09-04 08:14:42 -0700
commit40e0f6e5d1761afbe8e6354ee16cd1778ac1a34f (patch)
tree406746e9f9d24afef8cf67466d252b17bc409b7f
parenta03b100db84f140da24cabcaf58c940251bcb6d7 (diff)
downloadbitbake-contrib-40e0f6e5d1761afbe8e6354ee16cd1778ac1a34f.tar.gz
utils: Fix movefile() exception handling with python3
* with python3 this fails with: File: 'bitbake/lib/bb/utils.py', lineno: 799, function: movefile 0795: try: 0796: os.rename(src, destpath) 0797: renamefailed = 0 0798: except Exception as e: *** 0799: if e[0] != errno.EXDEV: 0800: # Some random error. 0801: print("movefile: Failed to move", src, "to", dest, e) 0802: return None 0803: # Invalid cross-device-link 'bind' mounted or actually Cross-Device Exception: TypeError: 'OSError' object is not subscriptable Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/bb/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 215c18cfa..f5bd816ce 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -796,7 +796,7 @@ def movefile(src, dest, newmtime = None, sstat = None):
os.rename(src, destpath)
renamefailed = 0
except Exception as e:
- if e[0] != errno.EXDEV:
+ if e.errno != errno.EXDEV:
# Some random error.
print("movefile: Failed to move", src, "to", dest, e)
return None