Skip to content

Commit 0f7ca09

Browse files
committed
autopep8
1 parent 6678ab1 commit 0f7ca09

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

lib/spack/spack/relocate.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class InstallRootStringException(spack.error.SpackError):
1818
"""
1919
Raised when the relocated binary still has the install root string.
2020
"""
21+
2122
def __init__(self, file_path, root_path):
2223
super(InstallRootStringException, self).__init__(
2324
"\n %s \ncontains string\n %s \n"
@@ -301,15 +302,15 @@ def relocate_binary(path_names, old_dir, new_dir, allow_root):
301302
if platform.system() == 'Darwin':
302303
for path_name in path_names:
303304
(rpaths, deps, idpath) = macho_get_paths(path_name)
304-
#one pass to replace placeholder
305+
# one pass to replace placeholder
305306
(n_rpaths,
306307
n_deps,
307308
n_idpath) = macho_replace_paths(placeholder,
308-
new_dir,
309-
rpaths,
310-
deps,
311-
idpath)
312-
#another pass to replace old_dir
309+
new_dir,
310+
rpaths,
311+
deps,
312+
idpath)
313+
# another pass to replace old_dir
313314
(new_rpaths,
314315
new_deps,
315316
new_idpath) = macho_replace_paths(old_dir,
@@ -322,24 +323,24 @@ def relocate_binary(path_names, old_dir, new_dir, allow_root):
322323
new_rpaths, new_deps, new_idpath)
323324
if (not allow_root and
324325
old_dir != new_dir and
325-
strings_contains_installroot(path_name, old_dir)):
326-
raise InstallRootStringException(path_name, old_dir)
326+
strings_contains_installroot(path_name, old_dir)):
327+
raise InstallRootStringException(path_name, old_dir)
327328

328329
elif platform.system() == 'Linux':
329330
for path_name in path_names:
330331
orig_rpaths = get_existing_elf_rpaths(path_name)
331332
if orig_rpaths:
332-
#one pass to replace placeholder
333+
# one pass to replace placeholder
333334
n_rpaths = substitute_rpath(orig_rpaths,
334-
placeholder, new_dir)
335-
#one pass to replace old_dir
335+
placeholder, new_dir)
336+
# one pass to replace old_dir
336337
new_rpaths = substitute_rpath(n_rpaths,
337338
old_dir, new_dir)
338339
modify_elf_object(path_name, new_rpaths)
339340
if (not allow_root and
340341
old_dir != new_dir and
341-
strings_contains_installroot(path_name, old_dir)):
342-
raise InstallRootStringException(path_name, old_dir)
342+
strings_contains_installroot(path_name, old_dir)):
343+
raise InstallRootStringException(path_name, old_dir)
343344
else:
344345
tty.die("Relocation not implemented for %s" % platform.system())
345346

@@ -359,8 +360,8 @@ def make_binary_relative(cur_path_names, orig_path_names, old_dir, allow_root):
359360
rpaths, deps, idpath,
360361
new_rpaths, new_deps, new_idpath)
361362
if (not allow_root and
362-
strings_contains_installroot(cur_path)):
363-
raise InstallRootStringException(cur_path)
363+
strings_contains_installroot(cur_path)):
364+
raise InstallRootStringException(cur_path)
364365
elif platform.system() == 'Linux':
365366
for cur_path, orig_path in zip(cur_path_names, orig_path_names):
366367
orig_rpaths = get_existing_elf_rpaths(cur_path)
@@ -369,8 +370,8 @@ def make_binary_relative(cur_path_names, orig_path_names, old_dir, allow_root):
369370
orig_rpaths)
370371
modify_elf_object(cur_path, new_rpaths)
371372
if (not allow_root and
372-
strings_contains_installroot(cur_path, old_dir)):
373-
raise InstallRootStringException(cur_path, old_dir)
373+
strings_contains_installroot(cur_path, old_dir)):
374+
raise InstallRootStringException(cur_path, old_dir)
374375
else:
375376
tty.die("Prelocation not implemented for %s" % platform.system())
376377

0 commit comments

Comments
 (0)