1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
Description: Fix gsettings-schema-convert pytwonisms.
Author: Dimitri John Ledkov <xnox@ubuntu.com>
--- gconf-3.2.6.orig/gsettings/gsettings-schema-convert
+++ gconf-3.2.6/gsettings/gsettings-schema-convert
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#! /usr/bin/python3
# vim: set ts=4 sw=4 et: coding=UTF-8
#
# Copyright (c) 2010, Novell, Inc.
@@ -603,7 +603,7 @@ class SimpleSchemaParser:
for line in lines:
current_line_nb += 1
self.parse_line(line)
- except GSettingsSchemaConvertException, e:
+ except GSettingsSchemaConvertException as e:
raise GSettingsSchemaConvertException('%s:%s: %s' % (os.path.basename(self.file), current_line_nb, e))
return self.root
@@ -1095,7 +1095,7 @@ def main(args):
try:
parser = GConfSchemaParser(argfile, options.gettext_domain, options.schema_id, options.keep_underscores)
schema_root = parser.parse()
- except SyntaxError, e:
+ except SyntaxError as e:
raise GSettingsSchemaConvertException('\'%s\' does not look like a valid gconf schema file: %s' % (argfile, e))
else:
# autodetect if file is XML or not
@@ -1104,7 +1104,7 @@ def main(args):
schema_root = parser.parse()
if not options.simple and not options.xml:
options.simple = True
- except SyntaxError, e:
+ except SyntaxError as e:
parser = SimpleSchemaParser(argfile)
schema_root = parser.parse()
if not options.simple and not options.xml:
@@ -1124,16 +1124,16 @@ def main(args):
sys.stdout.write(output)
else:
try:
- fout = open(options.output, 'w')
+ fout = open(options.output, 'wb')
fout.write(output)
fout.close()
- except GSettingsSchemaConvertException, e:
+ except GSettingsSchemaConvertException as e:
fout.close()
if os.path.exists(options.output):
os.unlink(options.output)
raise e
- except GSettingsSchemaConvertException, e:
+ except GSettingsSchemaConvertException as e:
print >> sys.stderr, '%s' % e
return 1
|