Skip to content

Commit

Permalink
Make doctests work on 3.7 again, which doesn't have importlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Dec 21, 2023
1 parent 073b1e1 commit 7694880
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/conf.py
Expand Up @@ -17,8 +17,16 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
from importlib import metadata
sys.path.append(os.path.abspath('../src/'))
try:
from importlib import metadata
except ImportError:
# Building the docs on 3.7. Which we don't do,
# except for running doctests.
glet_version = '0.0.0'
else:
glet_version = metadata.version('greenlet')


# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -58,7 +66,7 @@
# built documents.
#
# The short X.Y version.
version = metadata.version('greenlet')
version = glet_version
# The full version, including alpha/beta/rc tags.
release = version

Expand Down

0 comments on commit 7694880

Please sign in to comment.