Use existing shell quote function
authorLaurent Bachelier <laurent@bachelier.name>
Wed, 3 Oct 2012 19:54:56 +0000 (21:54 +0200)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 3 Oct 2012 20:25:59 +0000 (16:25 -0400)
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
irkerhook.py

index 40bc1555aea0c4cbdaed45151bb0b282feb5511a..ee9b671794e0ed42ff12f8ad744996901697ddec 100755 (executable)
@@ -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]