X-Git-Url: https://code.communitydata.science/cdsc_reddit.git/blobdiff_plain/06fd99e7cd50024f76dc90c96a75171f78208c73..aa84a7df032dcb20bb284892f12cdac4853f31aa:/helper.py diff --git a/helper.py b/helper.py index 4dc6210..b401cad 100644 --- a/helper.py +++ b/helper.py @@ -17,16 +17,8 @@ def find_dumps(dumpdir, base_pattern): ext_priority = ['.zst','.xz','.bz2'] for base, exts in dumpext.items(): - found = False - if len(exts) == 1: - yield base + exts[0] - found = True - else: - for ext in ext_priority: - if ext in exts: - yield base + ext - found = True - assert(found == True) + ext = [ext for ext in ext_priority if ext in exts][0] + yield base + ext def open_fileset(files): for fh in files: