Fix typo in parameter

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent c219c42804
commit 206d5ac5df

@ -641,22 +641,22 @@ def check_installability(inst_tester, binaries, arch, updates, affected, check_a
test_installability(inst_tester, name, pkg_id, broken, nuninst_arch) test_installability(inst_tester, name, pkg_id, broken, nuninst_arch)
def possibly_compressed(path, permitted_compressesion=None): def possibly_compressed(path, *, permitted_compressions=None):
"""Find and select a (possibly compressed) variant of a path """Find and select a (possibly compressed) variant of a path
If the given path exists, it will be returned If the given path exists, it will be returned
:param path The base path. :param path The base path.
:param permitted_compressesion An optional list of alternative extensions to look for. :param permitted_compressions An optional list of alternative extensions to look for.
Defaults to "gz" and "xz". Defaults to "gz" and "xz".
:returns The path given possibly with one of the permitted extensions. Will raise a :returns The path given possibly with one of the permitted extensions. Will raise a
FileNotFoundError FileNotFoundError
""" """
if os.path.exists(path): if os.path.exists(path):
return path return path
if permitted_compressesion is None: if permitted_compressions is None:
permitted_compressesion = ['gz', 'xz'] permitted_compressions = ['gz', 'xz']
for ext in permitted_compressesion: for ext in permitted_compressions:
cpath = "%s.%s" % (path, ext) cpath = "%s.%s" % (path, ext)
if os.path.exists(cpath): if os.path.exists(cpath):
return cpath return cpath

Loading…
Cancel
Save