1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +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
+4 -2
View File
@@ -235,12 +235,14 @@ def check_create_long_filename(filepath, pathname):
f = file(testfile, "w")
f.close()
os.remove(testfile)
except IOError as (errno, strerror):
except IOError as e:
errno, strerror = e.args
if errno == 36: # ENAMETOOLONG
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
else:
return "Failed to create a file in %s: %s.\n" % (pathname, strerror)
except OSError as (errno, strerror):
except OSError as e:
errno, strerror = e.args
return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror)
return ""