diff --git a/minio/api.py b/minio/api.py index 2dcffa854..23d3f7fa0 100644 --- a/minio/api.py +++ b/minio/api.py @@ -1997,9 +1997,15 @@ def remove_objects(self, bucket_name, delete_object_list, print("error occurred when deleting object", error) # Remove a prefix recursively. - delete_object_list = map( - lambda x: DeleteObject(x.object_name), - client.list_objects("my-bucket", "my/prefix/", recursive=True), + delete_object_list = list( + map( + lambda x: DeleteObject(x.object_name), + client.list_objects( + "my-bucket", + "my/prefix/", + recursive=True, + ), + ) ) errors = client.remove_objects("my-bucket", delete_object_list) for error in errors: