aboutsummaryrefslogtreecommitdiff
path: root/src/allocator.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/allocator.py')
-rw-r--r--src/allocator.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/allocator.py b/src/allocator.py
index dcb6511..2e223fe 100644
--- a/src/allocator.py
+++ b/src/allocator.py
@@ -152,12 +152,12 @@ class Allocator (object):
print_info2("Create allocator dictionary")
for attr in ["LD_PRELOAD", "cmd_prefix"]:
- try:
- value = getattr(self, attr)
- setattr(self, attr, value.format(**{"dir": self.dir,
- "srcdir": self.sources.dir}))
- except AttributeError:
- setattr(self, attr, "")
+ value = getattr(self, attr, "") or ""
+ paths = {"dir": self.dir}
+ paths["srcdir"] = self.sources.dir if self.sources is not None else ""
+
+ value = value.format(**paths)
+ setattr(self, attr, value)
res_dict = {"cmd_prefix": self.cmd_prefix,
"binary_suffix": self.binary_suffix or "",