comparison roundup/configuration.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 5a014410f254
children fc97f1f4a7e3
comparison
equal deleted inserted replaced
5382:1556b39fde7c 5383:6fbb7d52e38f
1435 if ini_file is None: 1435 if ini_file is None:
1436 ini_file = self.filepath 1436 ini_file = self.filepath
1437 _tmp_file = os.path.splitext(ini_file)[0] 1437 _tmp_file = os.path.splitext(ini_file)[0]
1438 _bak_file = _tmp_file + ".bak" 1438 _bak_file = _tmp_file + ".bak"
1439 _tmp_file = _tmp_file + ".tmp" 1439 _tmp_file = _tmp_file + ".tmp"
1440 _fp = file(_tmp_file, "wt") 1440 _fp = open(_tmp_file, "wt")
1441 _fp.write("# %s configuration file\n" % self._get_name()) 1441 _fp.write("# %s configuration file\n" % self._get_name())
1442 _fp.write("# Autogenerated at %s\n" % time.asctime()) 1442 _fp.write("# Autogenerated at %s\n" % time.asctime())
1443 need_set = self._get_unset_options() 1443 need_set = self._get_unset_options()
1444 if need_set: 1444 if need_set:
1445 _fp.write("\n# WARNING! Following options need adjustments:\n") 1445 _fp.write("\n# WARNING! Following options need adjustments:\n")

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