comparison roundup/cgi/TAL/talgettext.py @ 5248:198b6e810c67

Use Python-3-compatible 'as' syntax for except statements Many raise statements near these are also fixed. So are two ivorrect file encoding marks ('utf8'->'utf-8').
author Eric S. Raymond <esr@thyrsus.com>
date Thu, 24 Aug 2017 22:21:37 -0400
parents 3a407f0d5dad
children 64b05e24dbd8
comparison
equal deleted inserted replaced
5247:7f00a47b3559 5248:198b6e810c67
160 ID = 1 160 ID = 1
161 STR = 2 161 STR = 2
162 162
163 try: 163 try:
164 lines = open(self._filename).readlines() 164 lines = open(self._filename).readlines()
165 except IOError, msg: 165 except IOError as msg:
166 print >> sys.stderr, msg 166 print >> sys.stderr, msg
167 sys.exit(1) 167 sys.exit(1)
168 168
169 section = None 169 section = None
170 fuzzy = False 170 fuzzy = False
233 try: 233 try:
234 opts, args = getopt.getopt( 234 opts, args = getopt.getopt(
235 sys.argv[1:], 235 sys.argv[1:],
236 'ho:u:', 236 'ho:u:',
237 ['help', 'output=', 'update=']) 237 ['help', 'output=', 'update='])
238 except getopt.error, msg: 238 except getopt.error as msg:
239 usage(1, msg) 239 usage(1, msg)
240 240
241 outfile = None 241 outfile = None
242 engine = None 242 engine = None
243 update_mode = False 243 update_mode = False

Roundup Issue Tracker: http://roundup-tracker.org/