diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-02 11:31:23 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-02 11:48:23 +0200 |
| commit | c59dd31434018e74b44b0b5c8a79552a96c829a1 (patch) | |
| tree | 3b62874eb74b1473719bd265592483e91cc1c4bc | |
| parent | 57c769cce26aa6e373f637f578b2f8c76a1e7245 (diff) | |
| download | allocbench-c59dd31434018e74b44b0b5c8a79552a96c829a1.tar.gz allocbench-c59dd31434018e74b44b0b5c8a79552a96c829a1.zip | |
fix Allocator.build() if sources are None
| -rw-r--r-- | src/allocator.py | 12 |
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 "", |
