~robinmills/phatch/geotag

« back to all changes in this revision

Viewing changes to phatch/lib/imtools.py

  • Committer: spe.stani.be at gmail
  • Date: 2010-03-21 21:11:49 UTC
  • mfrom: (1887.1.11 windows)
  • Revision ID: spe.stani.be@gmail.com-20100321211149-zax6mxrsje14820m
Stani 2010-03-21 put tempfiles between try ... finally

Show diffs side-by-side

added added

removed removed

Lines of Context:
920
920
        raise InvalidWriteFormatError(format)
921
921
    except UnicodeEncodeError:
922
922
        temp = system.TempFile(suffix=os.path.splitext(filename)[-1])
923
 
        image.save(temp.path, **options)
924
 
        temp.close(dest=filename)
 
923
        try:
 
924
            image.save(temp.path, **options)
 
925
        finally:
 
926
            temp.close(dest=filename)
925
927
 
926
928
 
927
929
def save_check_mode(image, filename, **options):