Use non-mutable default for names in binary_distribution::get_specs call (#14696)

* Use non-mutable default for names

* Make suggested change
This commit is contained in:
Patrick Gartung 2020-01-30 15:17:55 -06:00 committed by GitHub
parent b072caadec
commit 12a99f4a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -664,7 +664,7 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False,
_cached_specs = None _cached_specs = None
def get_specs(force=False, use_arch=False, names=[]): def get_specs(force=False, use_arch=False, names=None):
""" """
Get spec.yaml's for build caches available on mirror Get spec.yaml's for build caches available on mirror
""" """
@ -676,6 +676,8 @@ def get_specs(force=False, use_arch=False, names=[]):
if use_arch: if use_arch:
arch_pattern = '(%s-%s-[^-]*)' % (arch.platform, arch.os) arch_pattern = '(%s-%s-[^-]*)' % (arch.platform, arch.os)
if names is None:
names = ['']
names_or_hashes = [name.replace('/', '') for name in names] names_or_hashes = [name.replace('/', '') for name in names]
names_pattern = '|'.join(names_or_hashes) names_pattern = '|'.join(names_or_hashes)
regex_pattern = '%s(.*)(%s)(.*)(spec.yaml$)' % (arch_pattern, regex_pattern = '%s(.*)(%s)(.*)(spec.yaml$)' % (arch_pattern,