/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 19:18:40 UTC
  • mto: This revision was merged to the branch mainline in revision 6928.
  • Revision ID: jelmer@jelmer.uk-20180218191840-2wezg20u9ffbfmed
Fix more bees, use with rather than try/finally for some files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
def get_long_description():
25
25
    dirname = os.path.dirname(__file__)
26
26
    readme = os.path.join(dirname, 'README')
27
 
    f = open(readme, 'rb')
28
 
    try:
 
27
    with open(readme, 'rb') as f:
29
28
        return f.read()
30
 
    finally:
31
 
        f.close()
32
29
 
33
30
 
34
31
##
133
130
                args = self._win_batch_args()
134
131
                batch_str = "@%s %s %s" % (python_exe, script_path, args)
135
132
                batch_path = os.path.join(self.install_dir, "brz.bat")
136
 
                f = file(batch_path, "w")
137
 
                f.write(batch_str)
138
 
                f.close()
 
133
                with file(batch_path, "w") as f:
 
134
                    f.write(batch_str)
139
135
                print(("Created: %s" % batch_path))
140
136
            except Exception:
141
137
                e = sys.exc_info()[1]