mercurial/pycompat.py
changeset 43019 2cc453284d5c
parent 40527 1b49b84d5ed5
child 43076 2372284d9457
equal deleted inserted replaced
43018:d1d919f679f7 43019:2cc453284d5c
   326         Python 3 compatibility as shelx.split() don't accept bytes on Python 3.
   326         Python 3 compatibility as shelx.split() don't accept bytes on Python 3.
   327         """
   327         """
   328         ret = shlex.split(s.decode('latin-1'), comments, posix)
   328         ret = shlex.split(s.decode('latin-1'), comments, posix)
   329         return [a.encode('latin-1') for a in ret]
   329         return [a.encode('latin-1') for a in ret]
   330 
   330 
       
   331     shlexquote = shlex.quote
       
   332 
   331 else:
   333 else:
   332     import cStringIO
   334     import cStringIO
       
   335     import pipes
   333 
   336 
   334     xrange = xrange
   337     xrange = xrange
   335     unicode = unicode
   338     unicode = unicode
   336     bytechr = chr
   339     bytechr = chr
   337     byterepr = repr
   340     byterepr = repr
   391     if getattr(sys, 'argv', None) is not None:
   394     if getattr(sys, 'argv', None) is not None:
   392         sysargv = sys.argv
   395         sysargv = sys.argv
   393     sysplatform = sys.platform
   396     sysplatform = sys.platform
   394     sysexecutable = sys.executable
   397     sysexecutable = sys.executable
   395     shlexsplit = shlex.split
   398     shlexsplit = shlex.split
       
   399     shlexquote = pipes.quote
   396     bytesio = cStringIO.StringIO
   400     bytesio = cStringIO.StringIO
   397     stringio = bytesio
   401     stringio = bytesio
   398     maplist = map
   402     maplist = map
   399     rangelist = range
   403     rangelist = range
   400     ziplist = zip
   404     ziplist = zip