From 78dfa63f95f69c06ba7a6fee6ad4b63c673b76dd Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Fri, 5 Oct 2012 23:14:32 +0200 Subject: [PATCH] made cowsay py2.6 compilant --- cowsay.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cowsay.py b/cowsay.py index 593cd8b..7f80be7 100644 --- a/cowsay.py +++ b/cowsay.py @@ -14,7 +14,9 @@ def cowsay(msg,args): return try: - txt=subprocess.check_call(["cowsay","-f",cowfile,text]) + p=subprocess.Popen(["cowsay","-f",cowfile,text],stdout=subprocess.PIPE) + p.wait() + txt=p.stdout.read() for line in txt.split('\n'): #brathuhn.sendStyledMsg(brathuhn.ROOM,line,'groupchat',) brathuhn.sendMonoMsg(brathuhn.ROOM,line,'groupchat')