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

Replace deprecated importlib.resources.path() call #493

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions conda/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import shutil
import progressbar
from jinja2 import Template
from importlib.resources import path
import importlib.resources
from configparser import ConfigParser

from mache import discover_machine, MachineInfo
Expand All @@ -30,8 +30,9 @@ def get_config(config_file, machine):

if machine is not None:
if not machine.startswith('conda'):
with path('mache.machines', f'{machine}.cfg') as machine_config:
config.read(str(machine_config))
machine_config = \
importlib.resources.files('mache.machines') / f'{machine}.cfg'
config.read(str(machine_config))

machine_config = os.path.join(here, '..', 'compass', 'machines',
'{}.cfg'.format(machine))
Expand Down