Show More
@@ -23,6 +23,7 b' import unicodedata' | |||||
23 | from .i18n import _ |
|
23 | from .i18n import _ | |
24 | from . import ( |
|
24 | from . import ( | |
25 | encoding, |
|
25 | encoding, | |
|
26 | pycompat, | |||
26 | ) |
|
27 | ) | |
27 |
|
28 | |||
28 | posixfile = open |
|
29 | posixfile = open | |
@@ -461,7 +462,7 b' def findexe(command):' | |||||
461 | if sys.platform == 'plan9': |
|
462 | if sys.platform == 'plan9': | |
462 | return findexisting(os.path.join('/bin', command)) |
|
463 | return findexisting(os.path.join('/bin', command)) | |
463 |
|
464 | |||
464 |
for path in os.environ.get('PATH', '').split( |
|
465 | for path in os.environ.get('PATH', '').split(pycompat.ospathsep): | |
465 | executable = findexisting(os.path.join(path, command)) |
|
466 | executable = findexisting(os.path.join(path, command)) | |
466 | if executable is not None: |
|
467 | if executable is not None: | |
467 | return executable |
|
468 | return executable |
@@ -4,6 +4,7 b' import os' | |||||
4 |
|
4 | |||
5 | from . import ( |
|
5 | from . import ( | |
6 | osutil, |
|
6 | osutil, | |
|
7 | pycompat, | |||
7 | util, |
|
8 | util, | |
8 | win32, |
|
9 | win32, | |
9 | ) |
|
10 | ) | |
@@ -33,7 +34,7 b' def systemrcpath():' | |||||
33 | if not isinstance(value, str) or not value: |
|
34 | if not isinstance(value, str) or not value: | |
34 | return rcpath |
|
35 | return rcpath | |
35 | value = util.localpath(value) |
|
36 | value = util.localpath(value) | |
36 |
for p in value.split( |
|
37 | for p in value.split(pycompat.ospathsep): | |
37 | if p.lower().endswith('mercurial.ini'): |
|
38 | if p.lower().endswith('mercurial.ini'): | |
38 | rcpath.append(p) |
|
39 | rcpath.append(p) | |
39 | elif os.path.isdir(p): |
|
40 | elif os.path.isdir(p): |
@@ -18,6 +18,7 b' from .i18n import _' | |||||
18 | from . import ( |
|
18 | from . import ( | |
19 | encoding, |
|
19 | encoding, | |
20 | osutil, |
|
20 | osutil, | |
|
21 | pycompat, | |||
21 | win32, |
|
22 | win32, | |
22 | ) |
|
23 | ) | |
23 |
|
24 | |||
@@ -303,7 +304,7 b' def findexe(command):' | |||||
303 | An extension from PATHEXT is found and added if not present. |
|
304 | An extension from PATHEXT is found and added if not present. | |
304 | If command isn't found None is returned.''' |
|
305 | If command isn't found None is returned.''' | |
305 | pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD') |
|
306 | pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD') | |
306 |
pathexts = [ext for ext in pathext.lower().split( |
|
307 | pathexts = [ext for ext in pathext.lower().split(pycompat.ospathsep)] | |
307 | if os.path.splitext(command)[1].lower() in pathexts: |
|
308 | if os.path.splitext(command)[1].lower() in pathexts: | |
308 | pathexts = [''] |
|
309 | pathexts = [''] | |
309 |
|
310 | |||
@@ -318,7 +319,7 b' def findexe(command):' | |||||
318 | if os.sep in command: |
|
319 | if os.sep in command: | |
319 | return findexisting(command) |
|
320 | return findexisting(command) | |
320 |
|
321 | |||
321 |
for path in os.environ.get('PATH', '').split( |
|
322 | for path in os.environ.get('PATH', '').split(pycompat.ospathsep): | |
322 | executable = findexisting(os.path.join(path, command)) |
|
323 | executable = findexisting(os.path.join(path, command)) | |
323 | if executable is not None: |
|
324 | if executable is not None: | |
324 | return executable |
|
325 | return executable |
General Comments 0
You need to be logged in to leave comments.
Login now