Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1500

Show
Ignore:
Timestamp:
12/09/06 17:31:03
Author:
fumanchu
Message:

2.x backport of [1154] (Quick and dirty trap of log file errors.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cputil.py

    r1439 r1500  
    127127    if fname: 
    128128        f = open(fname, 'ab') 
    129         f.write(s + '\n') 
    130         f.close() 
     129        try: 
     130            f.write(s + '\n') 
     131        finally: 
     132            f.close() 
    131133 
    132134 
     
    153155    if fname: 
    154156        f = open(fname, 'ab') 
    155         f.write(s + '\n') 
    156         f.close() 
     157        try: 
     158            f.write(s + '\n') 
     159        finally: 
     160            f.close() 
    157161 
    158162 

Hosted by WebFaction

Log in as guest/cpguest to create tickets