Commit 989ded90 authored by Martín Ferrari's avatar Martín Ferrari

Fix handling of slashes

parent 5ea69de9
...@@ -11,15 +11,15 @@ def find_bin(name, extra_path = None): ...@@ -11,15 +11,15 @@ def find_bin(name, extra_path = None):
if "PATH" in os.environ: if "PATH" in os.environ:
search += os.environ["PATH"].split(":") search += os.environ["PATH"].split(":")
for pref in ("/", "/usr/", "/usr/local/"): for pref in ("/", "/usr/", "/usr/local/"):
for d in ("bin/", "sbin/"): for d in ("bin", "sbin"):
search.append(pref + d) search.append(pref + d)
if extra_path: if extra_path:
search += extra_path search += extra_path
for d in search: for d in search:
try: try:
os.stat(d + name) os.stat(d + "/" + name)
return d + name return d + "/" + name
except OSError, e: except OSError, e:
if e.errno != os.errno.ENOENT: if e.errno != os.errno.ENOENT:
raise raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment