Skip to content

Commit

Permalink
Replace deprecated regex search with glob
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirving committed Oct 14, 2024
1 parent d7c65af commit 8d1960e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/lsst/ctrl/mpexec/cli/script/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,9 @@ def cleanup(
collection, butler.registry.getCollectionType(collection).name
)
return result
regex = re.compile(collection + ".+")
to_consider = set(butler.registry.queryCollections(regex))
to_keep.add(collection)
glob = collection + "*"
to_consider = set(butler.registry.queryCollections(glob))
to_remove = to_consider - to_keep
for r in to_remove:
if butler.registry.getCollectionType(r) == CollectionType.RUN:
Expand Down

0 comments on commit 8d1960e

Please sign in to comment.