From e6bc1c6863f507a792307b42fa301d8f93d8c33f Mon Sep 17 00:00:00 2001 From: Eva Schlinger Date: Fri, 7 Jun 2013 14:14:34 -0400 Subject: don't try to send graph in email if matplotlib import failed --- training/mira/mira.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'training') diff --git a/training/mira/mira.py b/training/mira/mira.py index 89822d41..f031c313 100755 --- a/training/mira/mira.py +++ b/training/mira/mira.py @@ -271,8 +271,10 @@ def write_report(graph_file, dev_results, dev_bleu, out.close() if args.email: - email_process = subprocess.Popen(['mail', '-s', subject, '-a', - graph_file, args.email], stdin = subprocess.PIPE) + cmd = ['mail', '-s', subject] + if graph_file: + cmd += ['-a', graph_file] + email_process = subprocess.Popen(cmd+[args.email], stdin = subprocess.PIPE) email_process.communicate(message) #feature weights stats for report -- cgit v1.2.3