Skip to content

Commit d61723c

Browse files
committed
don't use deprecated functions of importlib.resources
1 parent a42c773 commit d61723c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stagpy/args.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ def _bare_cmd(conf: Config) -> None:
4444
def _load_mplstyle(conf: Config) -> None:
4545
"""Try to load conf.plot.mplstyle matplotlib style."""
4646
for style in conf.plot.mplstyle:
47-
style_fname = style + ".mplstyle"
4847
# try packaged version
49-
if imlr.is_resource(_styles, style_fname):
50-
with imlr.path(_styles, style_fname) as stfile:
48+
style_file = imlr.files(_styles).joinpath(f"{style}.mplstyle")
49+
if style_file.is_file():
50+
with imlr.as_file(style_file) as stfile:
5151
mpls.use(str(stfile))
5252
continue
5353
mpls.use(style)

0 commit comments

Comments
 (0)