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:06:50 +0100 |
commit | 2ac4f8b39711209ba9323fc221c1dcd185da57ea (patch) | |
tree | cbaa1e573abd13c7827a5b4a57724fd884df148b /meta/classes/sanity.bbclass | |
parent | 00052fe69582f238166511e733d3ba875cbe0ad2 (diff) | |
download | poky-2ac4f8b39711209ba9323fc221c1dcd185da57ea.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.
(From OE-Core rev: b010501cd089e649a68f683be0cf4d0aac90fbe3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r-- | meta/classes/sanity.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index ac2314fdcf..766e97e916 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -235,12 +235,14 @@ def check_create_long_filename(filepath, pathname): | |||
235 | f = file(testfile, "w") | 235 | f = file(testfile, "w") |
236 | f.close() | 236 | f.close() |
237 | os.remove(testfile) | 237 | os.remove(testfile) |
238 | except IOError as (errno, strerror): | 238 | except IOError as e: |
239 | errno, strerror = e.args | ||
239 | if errno == 36: # ENAMETOOLONG | 240 | if errno == 36: # ENAMETOOLONG |
240 | return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname | 241 | return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname |
241 | else: | 242 | else: |
242 | return "Failed to create a file in %s: %s.\n" % (pathname, strerror) | 243 | return "Failed to create a file in %s: %s.\n" % (pathname, strerror) |
243 | except OSError as (errno, strerror): | 244 | except OSError as e: |
245 | errno, strerror = e.args | ||
244 | return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror) | 246 | return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror) |
245 | return "" | 247 | return "" |
246 | 248 | ||