diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2019-09-04 07:36:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-06 11:58:56 +0100 |
commit | 3103c383b3aa637a8f81582ddd5bc67aff46b3f5 (patch) | |
tree | b9d73dc4fc1f27fe392095611b7a4f80af299b5a /bitbake/lib | |
parent | cb26830f765f03309c0663352cc5849491271be8 (diff) | |
download | poky-3103c383b3aa637a8f81582ddd5bc67aff46b3f5.tar.gz |
bitbake: 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
(Bitbake rev: 9f92322fa8d6f1a68c0c3f4984afdf65126b51dc)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 215c18cfa3..f5bd816ced 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -796,7 +796,7 @@ def movefile(src, dest, newmtime = None, sstat = None): | |||
796 | os.rename(src, destpath) | 796 | os.rename(src, destpath) |
797 | renamefailed = 0 | 797 | renamefailed = 0 |
798 | except Exception as e: | 798 | except Exception as e: |
799 | if e[0] != errno.EXDEV: | 799 | if e.errno != errno.EXDEV: |
800 | # Some random error. | 800 | # Some random error. |
801 | print("movefile: Failed to move", src, "to", dest, e) | 801 | print("movefile: Failed to move", src, "to", dest, e) |
802 | return None | 802 | return None |