1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

clases/lib: Use modern exception syntax

Update older code to use modern exception handling syntax which
is the form accepted by python 3.

(From OE-Core rev: b010501cd089e649a68f683be0cf4d0aac90fbe3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-05-07 13:55:55 +01:00
parent 00052fe695
commit 2ac4f8b397
9 changed files with 19 additions and 15 deletions
+2 -2
View File
@@ -125,7 +125,7 @@ class CachedPath(object):
# Note that listdir and error are globals in this module due
# to earlier import-*.
names = os.listdir(top)
except error, err:
except error as err:
if onerror is not None:
onerror(err)
return
@@ -221,7 +221,7 @@ class CachedPath(object):
file = self.__realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
else:
file = self.__realpath(file, root, loop_cnt, assume_dir)[0]
except OSError, e:
except OSError as e:
if e.errno == errno.ELOOP:
# make ELOOP more readable; without catching it, there will
# be printed a backtrace with 100s of OSError exceptions