- Refer to subprocess.CalledProcessError correctly

- Add space after operator ">>"
This commit is contained in:
Daniel Hahler 2008-02-09 03:48:57 +01:00
parent 72600ec914
commit 060659df0c

View File

@ -328,14 +328,14 @@ if __name__ == '__main__':
# Launch editor # Launch editor
try: try:
editor = subprocess.check_call( ['sensible-editor', report_file.name] ) editor = subprocess.check_call( ['sensible-editor', report_file.name] )
except CalledProcessError, e: except subprocess.CalledProcessError, e:
print >>sys.stderr, 'sensible-editor returned with %s: %s\nAborting.' % (editor.returncode, e) print >> sys.stderr, 'Error calling sensible-editor: %s\nAborting.' % (e,)
sys.exit(1) sys.exit(1)
# Check if the tempfile has been changed # Check if the tempfile has been changed
report_file_info = os.stat( report_file.name ) report_file_info = os.stat( report_file.name )
if mtime_before == os.stat( report_file.name ).st_mtime: if mtime_before == os.stat( report_file.name ).st_mtime:
print >>sys.stderr, 'The temporary file %s has not been changed. Aborting. [Press ENTER]' % (report_file.name,) print >> sys.stderr, 'The temporary file %s has not been changed. Aborting. [Press ENTER]' % (report_file.name,)
raw_input() raw_input()
sys.exit(1) sys.exit(1)
report_file.file.seek(0) report_file.file.seek(0)