/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 breezy/textfile.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:
48
48
    """Check whether the supplied path is a text, not binary file.
49
49
    Raise BinaryFile if a NUL occurs in the first 1024 bytes.
50
50
    """
51
 
    f = open(path, 'rb')
52
 
    try:
 
51
    with open(path, 'rb') as f:
53
52
        text_file(f)
54
 
    finally:
55
 
        f.close()