Changeset 413 for trunk


Ignore:
Timestamp:
02/11/05 14:43:16 (20 years ago)
Author:
mar637
Message:

Added catch for illegal filenames in summary to file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r411 r413  
    167167            if filename is "":
    168168                filename = 'scantable_summary.txt'
    169             from os.path import expandvars
     169            from os.path import expandvars, isfile
    170170            filename = expandvars(filename)
    171             data = open(filename, 'w')
    172             data.write(info)
    173             data.close()
     171            if isfile(filename):
     172                data = open(filename, 'w')
     173                data.write(info)
     174                data.close()
     175            else:
     176                print "Illegal file name '%s'." % (filename)
    174177        print info
    175178
Note: See TracChangeset for help on using the changeset viewer.