From 0a132ca642a39495285e50f0a7ce6ec3566c71a5 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(-) 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