X-Git-Url: https://git.cweiske.de/errbot-exec.git/blobdiff_plain/a313e2911f4aa55c38056669e7386a0d1c6cbe38..refs/heads/master:/exec.py diff --git a/exec.py b/exec.py index 207a4f9..d91fc2b 100644 --- a/exec.py +++ b/exec.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import os, re, subprocess -from errbot import BotPlugin, botcmd, re_botcmd -from errbot.utils import ValidationException +from errbot import BotPlugin, botcmd, re_botcmd, ValidationException class Exec(BotPlugin): """ @@ -60,15 +59,15 @@ class Exec(BotPlugin): """ try: output = subprocess.check_output( - [self.config['command'], unicode(msg.body), unicode(msg.frm)], + [self.config['command'], msg.body, str(msg.frm)], stderr=subprocess.STDOUT ) if len(output) > 0: - return unicode(output, 'utf-8') + return str(output, 'utf-8') else: return "OK\n" except subprocess.CalledProcessError as err: if len(err.output): - return unicode(err.output, 'utf-8') + return str(err.output, 'utf-8') else: return "Error"