diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-07 13:55:55 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 14:04:18 +0100 |
commit | b010501cd089e649a68f683be0cf4d0aac90fbe3 (patch) | |
tree | ce5c7cba76051675e4a765dd677ffed372d4e33a /meta/lib/oe/path.py | |
parent | 3c104443506cb89d72944e46096a94a80838a707 (diff) | |
download | openembedded-core-contrib-b010501cd089e649a68f683be0cf4d0aac90fbe3.tar.gz |
clases/lib: Use modern exception syntax
Update older code to use modern exception handling syntax which
is the form accepted by python 3.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/path.py')
-rw-r--r-- | meta/lib/oe/path.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 76a6ed8314..d8eb80225f 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -107,7 +107,7 @@ def remove(path, recurse=True): for name in glob.glob(path): try: os.unlink(name) - except OSError, exc: + except OSError as exc: if recurse and exc.errno == errno.EISDIR: shutil.rmtree(name) elif exc.errno != errno.ENOENT: @@ -119,7 +119,7 @@ def symlink(source, destination, force=False): if force: remove(destination) os.symlink(source, destination) - except OSError, e: + except OSError as e: if e.errno != errno.EEXIST or os.readlink(destination) != source: raise @@ -247,7 +247,7 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False) file = __realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir) else: file = __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 |