diff mercurial/posix.py @ 30612:d623cc6b3742

py3: replace os.pathsep with pycompat.ospathsep os.pathsep returns unicode on Python 3. We already have pycompat.ospathsep which return bytes on Python 3. This patch replaces all the occurrences of os.pathsep in the codebase (excluding tests) to pycompat.ospathsep.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 17 Dec 2016 19:47:17 +0530
parents 6a672c3b7860
children cfe66dcf45c0
line wrap: on
line diff
--- a/mercurial/posix.py	Sat Dec 17 19:36:40 2016 +0530
+++ b/mercurial/posix.py	Sat Dec 17 19:47:17 2016 +0530
@@ -23,6 +23,7 @@
 from .i18n import _
 from . import (
     encoding,
+    pycompat,
 )
 
 posixfile = open
@@ -461,7 +462,7 @@
     if sys.platform == 'plan9':
         return findexisting(os.path.join('/bin', command))
 
-    for path in os.environ.get('PATH', '').split(os.pathsep):
+    for path in os.environ.get('PATH', '').split(pycompat.ospathsep):
         executable = findexisting(os.path.join(path, command))
         if executable is not None:
             return executable