Change importlib_resources imports to be compatible with python 3.7
Currently mailman uses a lot of importlib_resources imports. This is a module that backports python 3.7 functionality, which in 3.7 is available as importlib.resources. (In theory the importlib_resources module can be installed in 3.7 and will provide a wrapper, but understandably distributions often don't package that.)
Thus to make the code work in both scenarios one could add imports like:
try:
from importlib.resources import read_text
except ImportError: # for Python<3.7
from importlib_resources import read_text
Would you accept a patch to change all these constructs?
Unfortunately that is not all to make mailman work on a python3.7-without-importlib_resources system, it also needs to be removed from requirements.txt (and I don't think requirements.txt supports conditional dependencies based on python versions).
(FWIW I'm attaching a quick-and-dirtry script to replace the importlib_resources imports with constructions like the one above and a patch against mailman 3.3.0.) fix-importlib_resources mailman-3.3.0-importlib_resources-fix.diff