From 8d31fa3cce47a7c9d932b872e277cf89eb3441a2 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 25 Aug 2014 10:18:01 +0200 Subject: [execafterdownload] Simplify (#3569) --- youtube_dl/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 8095400d0..2b05fd7b7 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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) -- cgit v1.2.3