debian/patches/features/all/rt/genpatch.py: Use Python 3

This commit is contained in:
Ben Hutchings 2016-06-05 17:41:39 +01:00
parent 4e2a281abe
commit 0724abc432
2 changed files with 8 additions and 7 deletions

1
debian/changelog vendored
View File

@ -14,6 +14,7 @@ linux (4.6.1-1~exp1) UNRELEASED; urgency=medium
* linux-image: Make a newly installed kernel the default if the package
was previously removed
* mtd: Disable slram and phram when securelevel is enabled
* debian/patches/features/all/rt/genpatch.py: Use Python 3
-- Ben Hutchings <ben@decadent.org.uk> Sat, 04 Jun 2016 18:33:11 +0100

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
import errno, os, os.path, re, shutil, subprocess, sys
@ -15,7 +15,7 @@ def main(source_dir, version):
name = line.strip()
if name != '' and name[0] != '#':
old_series.add(name)
except IOError, e:
except IOError as e:
if e.errno != errno.ENOENT:
raise
@ -27,7 +27,7 @@ def main(source_dir, version):
path = os.path.join(patch_dir, name)
try:
os.unlink(path)
except OSError, e:
except OSError as e:
if e.errno != errno.ENOENT:
raise
with open(path, 'w') as patch:
@ -81,14 +81,14 @@ def main(source_dir, version):
if name in old_series:
old_series.remove(name)
else:
print 'Added patch', os.path.join(patch_dir, name)
print('Added patch', os.path.join(patch_dir, name))
for name in old_series:
print 'Obsoleted patch', os.path.join(patch_dir, name)
print('Obsoleted patch', os.path.join(patch_dir, name))
if __name__ == '__main__':
if len(sys.argv) != 3:
print >>sys.stderr, 'Usage: %s DIR RT-VERSION' % sys.argv[0]
print >>sys.stderr, 'DIR is either a git repo or quilt directory containing the given RT-VERSION.'
print('Usage: %s DIR RT-VERSION' % sys.argv[0], file=sys.stderr)
print('DIR is either a git repo or quilt directory containing the given RT-VERSION.', file=sys.stderr)
sys.exit(2)
main(sys.argv[1], sys.argv[2])