Commit e02b9114 authored by Iustin Pop's avatar Iustin Pop
Browse files

Replace os.path.sep.join(seq) with utils.PathJoin

This is a no-op change, but at least we concentrate the calls to path
joins into a single function.

A use in utils.FindFile is left as-is (don't want to raise exceptions
there, at least for now).
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 81a3406c
......@@ -1682,7 +1682,7 @@ def _OSOndiskAPIVersion(os_dir):
data holding either the vaid versions or an error message
api_file = os.path.sep.join([os_dir, constants.OS_API_FILE])
api_file = utils.PathJoin(os_dir, constants.OS_API_FILE)
st = os.stat(api_file)
......@@ -1738,7 +1738,7 @@ def DiagnoseOS(top_dirs=None):
logging.exception("Can't list the OS directory %s: %s", dir_name, err)
for name in f_names:
os_path = os.path.sep.join([dir_name, name])
os_path = utils.PathJoin(dir_name, name)
status, os_inst = _TryOSFromDisk(name, base_dir=dir_name)
if status:
diagnose = ""
......@@ -1789,7 +1789,7 @@ def _TryOSFromDisk(name, base_dir=None):
os_files[constants.OS_VARIANTS_FILE] = ''
for filename in os_files:
os_files[filename] = os.path.sep.join([os_dir, filename])
os_files[filename] = utils.PathJoin(os_dir, filename)
st = os.stat(os_files[filename])
......@@ -1748,6 +1748,7 @@ def FindFile(name, search_path, test=os.path.exists):
return None
for dir_name in search_path:
# FIXME: investigate switch to PathJoin
item_name = os.path.sep.join([dir_name, name])
# check the user test and that we're indeed resolving to the given
# basename
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