equal
deleted
inserted
replaced
320 if os.sys.platform == 'OpenVMS': |
320 if os.sys.platform == 'OpenVMS': |
321 return '"%s"' % s |
321 return '"%s"' % s |
322 global _needsshellquote |
322 global _needsshellquote |
323 if _needsshellquote is None: |
323 if _needsshellquote is None: |
324 _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search |
324 _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search |
325 if not _needsshellquote(s): |
325 if s and not _needsshellquote(s): |
326 # "s" shouldn't have to be quoted |
326 # "s" shouldn't have to be quoted |
327 return s |
327 return s |
328 else: |
328 else: |
329 return "'%s'" % s.replace("'", "'\\''") |
329 return "'%s'" % s.replace("'", "'\\''") |
330 |
330 |