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 692bbc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lsst/ctrl/mpexec/cli/script/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.


import re
from typing import Any

from lsst.daf.butler import Butler, CollectionType
Expand Down Expand Up @@ -141,8 +140,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 692bbc2

Please sign in to comment.