From 0a7af36fe787710c17f2a74be1254e37c064c949 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 3 Oct 2012 21:54:56 +0200 Subject: [PATCH] Use existing shell quote function Signed-off-by: Eric S. Raymond --- irkerhook.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/irkerhook.py b/irkerhook.py index 40bc155..ee9b671 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -38,12 +38,10 @@ default_channels = "irc://chat.freenode.net/%(project)s,irc://chat.freenode.net/ # import os, sys, commands, socket, urllib, json +from pipes import quote as shellquote version = "1.5" -def shellquote(s): - return "'" + s.replace("'","'\\''") + "'" - def do(command): return commands.getstatusoutput(command)[1] -- 2.26.2