29 """Search for depot_tools and add it to sys.path."""
30
31 deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools')
33
34
35 sys.path.insert(0, deps_depot_tools)
36 return deps_depot_tools
37
38
39 for i in sys.path:
41 return i
42
43 for i in os.environ['PATH'].split(os.pathsep):
45 sys.path.append(i.rstrip(os.sep))
46 return i
47
48 root_dir = os.path.dirname(os.path.abspath(__file__))
49 previous_dir = os.path.abspath(__file__)
50 while root_dir and root_dir != previous_dir:
51 i = os.path.join(root_dir, 'depot_tools')
53 sys.path.append(i)
54 return i
55 previous_dir = root_dir
56 root_dir = os.path.dirname(root_dir)
57 print(
'Failed to find depot_tools', file=sys.stderr)
58 return None
59
def print(*args, **kwargs)