Import ABCs from collections.abc, not collections

The types in collections.abc were moved from just collections in Python
3.3, and Python 3.10 removed the old aliases. We no longer support
Python versions earlier than 3.3 and need to support 3.10, so update the
import.
This commit is contained in:
Peter Marheine 2021-12-23 10:27:14 +11:00
parent 0578729a66
commit 95b36fc843

View file

@ -4,7 +4,7 @@ Download middlewares capture :py:class:`django_downloadview.DownloadResponse`
responses and may replace them with optimized download responses.
"""
import collections
import collections.abc
import copy
import os
@ -160,7 +160,7 @@ class SmartDownloadMiddleware(BaseDownloadMiddleware):
for key, options in enumerate(options_list):
args = []
kwargs = {}
if isinstance(options, collections.Mapping): # Using kwargs.
if isinstance(options, collections.abc.Mapping): # Using kwargs.
kwargs = options
else:
args = options