Skip to content

Commit 3857f7f

Browse files
committed
Switch to pathlib
1 parent 9e04e29 commit 3857f7f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mpl_sphinx_theme/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from ._version import __version__
22

3-
from os import path
3+
from pathlib import Path
4+
45

56
def get_html_theme_path():
67
"""Return list of HTML theme paths."""
7-
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
8-
return cur_dir
8+
return [str(Path(__file__).parent.parent.resolve())]
9+
910

10-
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
11+
# See https://www.sphinx-doc.org/en/master/development/theming.html#distribute-your-theme-as-a-python-package
1112
def setup(app):
12-
app.add_html_theme("mpl_sphinx_theme", path.abspath(path.dirname(__file__)))
13+
app.add_html_theme("mpl_sphinx_theme",
14+
str(Path(__file__).parent.resolve()))

0 commit comments

Comments
 (0)