Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7812ee

Browse files
Updating regex used to split sphinx version string.
The latest stable sphinx version string is '1.2+'. The regex pattern '[a-z]' fails to match the '+' character leading to a `ValueError` being raised when it attempts to cast '2+' to an int. Replacing '[a-z]' with '[^0-9]' resolves this.
1 parent 9be5ac4 commit b7812ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
sphinx_version = sphinx.__version__.split(".")
148148
# The split is necessary for sphinx beta versions where the string is
149149
# '6b1'
150-
sphinx_version = tuple([int(re.split('[a-z]', x)[0])
150+
sphinx_version = tuple([int(re.split('[^0-9]', x)[0])
151151
for x in sphinx_version[:2]])
152152

153153
try:

0 commit comments

Comments
 (0)