diff --git a/gstlal/python/dagparts.py b/gstlal/python/dagparts.py
index f2fa361e85c53b83b49ae6f361ee5a4117fdd874..7148057962b127d09c074b7017ab8467254b39ce 100644
--- a/gstlal/python/dagparts.py
+++ b/gstlal/python/dagparts.py
@@ -64,8 +64,7 @@ def which(prog):
 	which = subprocess.Popen(['which',prog], stdout=subprocess.PIPE)
 	out = which.stdout.read().strip()
 	if not out:
-		print >>sys.stderr, "ERROR: could not find %s in your path, have you built the proper software and sourced the proper environment scripts?" % (prog,prog)
-		raise ValueError
+		raise ValueError("could not find %s in your path, have you built the proper software and sourced the proper environment scripts?" % prog)
 	return out