diff options
author | Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org> | 2018-11-26 21:12:53 +0100 |
---|---|---|
committer | Marie Alexandre <alexandre.marie@synchrotron-soleil.fr> | 2019-07-08 11:31:53 +0200 |
commit | 9d1c321e8f66c85548fd1ad774ec5cce14cc2e2f (patch) | |
tree | 8ac3f411a2ce57ea271bf329144bde182188ff1a | |
parent | 85e0321f21f976b89fc837b37a37dd63155c8409 (diff) |
reproducible-build
Gbp-Pq: Name 0002-reproducible-build.patch
-rw-r--r-- | fabio/compression.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fabio/compression.py b/fabio/compression.py index 8fe3148..a8a3497 100644 --- a/fabio/compression.py +++ b/fabio/compression.py @@ -115,9 +115,9 @@ def endianness(): class ExternalCompressors(object): """Class to handle lazy discovery of external compression programs""" - COMMANDS = {".bz2": ["bzip2" "-dcf"], - ".gz": ["gzip", "-dcf"] - } + COMMANDS = ((".bz2", ["bzip2" "-dcf"]), + (".gz", ["gzip", "-dcf"]), + ) def __init__(self): """Empty constructor""" @@ -126,8 +126,9 @@ class ExternalCompressors(object): def __getitem__(self, key): """Implement the dict-like behavior""" if key not in self.compressors: - if key in self.COMMANDS: - commandline = self.COMMANDS[key] + for candidate, commandline in self.COMMANDS: + if key != candidate: + continue testline = [commandline[0], "-h"] try: lines = subprocess.check_output(testline, |