~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Martin
  • Date: 2010-05-25 16:45:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5257.
  • Revision ID: gzlist@googlemail.com-20100525164512-fh0db3r3v502wyni
Workingtree changes sitting around since November, more explict closing of files in bzrlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
1818
1818
    base = dirname(bzrlib.__file__)
1819
1819
    if getattr(sys, 'frozen', None):    # bzr.exe
1820
1820
        base = abspath(pathjoin(base, '..', '..'))
1821
 
    filename = pathjoin(base, resource_relpath)
1822
 
    return open(filename, 'rU').read()
1823
 
 
 
1821
    f = file(pathjoin(base, resource_relpath), "rU")
 
1822
    try:
 
1823
        return f.read()
 
1824
    finally:
 
1825
        f.close()
1824
1826
 
1825
1827
def file_kind_from_stat_mode_thunk(mode):
1826
1828
    global file_kind_from_stat_mode