~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-26 11:24:26 UTC
  • mfrom: (4708.2.3 filelifetimes)
  • Revision ID: pqm@pqm.ubuntu.com-20100526112426-r041wtw03oqi4hj1
(lifeless) Explicitly close various file objects used in bzrlib (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
2078
2078
    base = dirname(bzrlib.__file__)
2079
2079
    if getattr(sys, 'frozen', None):    # bzr.exe
2080
2080
        base = abspath(pathjoin(base, '..', '..'))
2081
 
    filename = pathjoin(base, resource_relpath)
2082
 
    return open(filename, 'rU').read()
2083
 
 
 
2081
    f = file(pathjoin(base, resource_relpath), "rU")
 
2082
    try:
 
2083
        return f.read()
 
2084
    finally:
 
2085
        f.close()
2084
2086
 
2085
2087
def file_kind_from_stat_mode_thunk(mode):
2086
2088
    global file_kind_from_stat_mode