[linux] 02/02: debian/patches/features/all/rt/genpatch.py: Catch more specific exception class
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Thu Dec 8 21:08:15 UTC 2016
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch master
in repository linux.
commit 9287597ec2dcb9154c410a792c23355618f3639b
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Thu Dec 8 19:25:12 2016 +0000
debian/patches/features/all/rt/genpatch.py: Catch more specific exception class
Now that we use Python 3, we can simply catch FileNotFoundError
instead of checking the IOError error code.
---
debian/patches/features/all/rt/genpatch.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/debian/patches/features/all/rt/genpatch.py b/debian/patches/features/all/rt/genpatch.py
index a917c94..6253a4e 100755
--- a/debian/patches/features/all/rt/genpatch.py
+++ b/debian/patches/features/all/rt/genpatch.py
@@ -15,9 +15,8 @@ def main(source, version=None):
name = line.strip()
if name != '' and name[0] != '#':
old_series.add(name)
- except IOError as e:
- if e.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
+ pass
with open(os.path.join(patch_dir, series_name), 'w') as series_fh:
# Add directory prefix to all filenames.
@@ -27,9 +26,8 @@ def main(source, version=None):
path = os.path.join(patch_dir, name)
try:
os.unlink(path)
- except OSError as e:
- if e.errno != errno.ENOENT:
- raise
+ except FileNotFoundError:
+ pass
with open(path, 'w') as patch:
in_header = True
for line in source_patch:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list