comparison roundup/cgi/TAL/talgettext.py @ 5383:6fbb7d52e38f

Python 3 preparation: use open() instead of file(). Tool-assisted patch. Note one case where a simple substitution did not suffice because the change was in a class that defined its own open() method earlier, and thus needed to use builtins.open (respectively __builtin__.open in Python 2).
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 22:10:24 +0000
parents 64b05e24dbd8
children 23b8e6067f7c
comparison
equal deleted inserted replaced
5382:1556b39fde7c 5383:6fbb7d52e38f
283 # Now output the keys in the engine. Write them to a file if --output or 283 # Now output the keys in the engine. Write them to a file if --output or
284 # --update was specified; otherwise use standard out. 284 # --update was specified; otherwise use standard out.
285 if (outfile is None): 285 if (outfile is None):
286 outfile = sys.stdout 286 outfile = sys.stdout
287 else: 287 else:
288 outfile = file(outfile, update_mode and "a" or "w") 288 outfile = open(outfile, update_mode and "a" or "w")
289 289
290 catalog = {} 290 catalog = {}
291 for domain in engine.catalog.keys(): 291 for domain in engine.catalog.keys():
292 catalog.update(engine.catalog[domain]) 292 catalog.update(engine.catalog[domain])
293 293

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