we're aware that the importlib.path is being deprecated but we still want to support python 3.8, which does not have the as_file function.
also noticed that when the resources.path() used in a with clause, it raises an exception when the file is not present in Python 3.8.10, which is the latest python 3.8 version in Focal at the moment. Therefore, used contextlib.suppress(Exception) to deal with that as well.
we're aware that the importlib.path is being deprecated but we still want to support python 3.8, which does not have the
as_file
function.also noticed that when the resources.path() used in a with clause, it raises an exception when the file is not present in Python 3.8.10, which is the latest python 3.8 version in Focal at the moment. Therefore, used contextlib.suppress(Exception) to deal with that as well.
Relevant past MP's: #864, #854