mercurial/pycompat.py
changeset 38332 7b12a2d2eedc
parent 38312 79dd61a4554f
child 38575 152f4822d210
equal deleted inserted replaced
38331:cf59de802883 38332:7b12a2d2eedc
   292         shlex.split(), convert the returned value to bytes and return that for
   292         shlex.split(), convert the returned value to bytes and return that for
   293         Python 3 compatibility as shelx.split() don't accept bytes on Python 3.
   293         Python 3 compatibility as shelx.split() don't accept bytes on Python 3.
   294         """
   294         """
   295         ret = shlex.split(s.decode('latin-1'), comments, posix)
   295         ret = shlex.split(s.decode('latin-1'), comments, posix)
   296         return [a.encode('latin-1') for a in ret]
   296         return [a.encode('latin-1') for a in ret]
   297 
       
   298     def emailparser(*args, **kwargs):
       
   299         import email.parser
       
   300         return email.parser.BytesParser(*args, **kwargs)
       
   301 
   297 
   302 else:
   298 else:
   303     import cStringIO
   299     import cStringIO
   304 
   300 
   305     unicode = unicode
   301     unicode = unicode
   369     rangelist = range
   365     rangelist = range
   370     ziplist = zip
   366     ziplist = zip
   371     rawinput = raw_input
   367     rawinput = raw_input
   372     getargspec = inspect.getargspec
   368     getargspec = inspect.getargspec
   373 
   369 
   374     def emailparser(*args, **kwargs):
       
   375         import email.parser
       
   376         return email.parser.Parser(*args, **kwargs)
       
   377 
       
   378 isjython = sysplatform.startswith('java')
   370 isjython = sysplatform.startswith('java')
   379 
   371 
   380 isdarwin = sysplatform == 'darwin'
   372 isdarwin = sysplatform == 'darwin'
   381 isposix = osname == 'posix'
   373 isposix = osname == 'posix'
   382 iswindows = osname == 'nt'
   374 iswindows = osname == 'nt'