Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli/get_repo_info: suppress importlib.path deprecation warning #925

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xmkg
Copy link
Contributor

@xmkg xmkg commented Jul 4, 2024

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

@xmkg xmkg requested review from dosaboy and pponnuvel July 4, 2024 11:02
@xmkg xmkg force-pushed the enhancement/suppress-importlib-deprecation-warning branch 2 times, most recently from 45368e4 to da95871 Compare July 4, 2024 11:09
@xmkg xmkg force-pushed the enhancement/suppress-importlib-deprecation-warning branch from da95871 to 9d622e1 Compare July 12, 2024 06:55
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.
so, this patch suppresses the annoying deprecation warning.

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: canonical#864, canonical#854

Signed-off-by: Mustafa Kemal Gilor <[email protected]>
@xmkg xmkg force-pushed the enhancement/suppress-importlib-deprecation-warning branch from 9d622e1 to 5ebcd2b Compare July 30, 2024 10:51
@xmkg
Copy link
Contributor Author

xmkg commented Jul 30, 2024

@dosaboy rebased this one, should be trivial enough to land.

Copy link
Member

@pponnuvel pponnuvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants