[execafterdownload] Simplify (#3569)
[youtube-dl] / youtube_dl / utils.py
index 8095400d03dee6731b2bd24951597b74a90f1991..2b05fd7b7f4076a7d934033ceaeb116f6f8491ca 100644 (file)
@@ -192,6 +192,13 @@ try:
 except ImportError:  # Python 2.6
     from xml.parsers.expat import ExpatError as compat_xml_parse_error
 
+try:
+    from shlex import quote as shlex_quote
+except ImportError:  # Python < 3.3
+    def shlex_quote(s):
+        return "'" + s.replace("'", "'\"'\"'") + "'"
+
+
 def compat_ord(c):
     if type(c) is int: return c
     else: return ord(c)