Avoid a Python deprecation warning with the collections patch.
Review Request #12312 — Created May 31, 2022 and submitted
Django Evolution provides a compatibility patch to enable
collections.Callableon Python 3.10 with Django <= 2.0. To check
whether to apply the patch, we were checking for the existence of
collections.Callableand the Django version.
The first check led to a deprecation warning on modern versions of
Python, which is annoying when running on a version of Django not
susceptible to the old imports. Instead, we now check the Django version
first, avoiding the warning.
Started up a dev server and saw that the warning no longer appeared.