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

Skip to content

Commit a916604

Browse files
committed
Add __version_info__ as a tuple-based version identifier
1 parent e69e2e6 commit a916604

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@
115115
# this is computed based on the number of commits since the last tag.
116116
from ._version import get_versions
117117
__version__ = str(get_versions()['version'])
118+
119+
_m = re.match(r'^(\d+)\.(\d+)\.(\d+)', __version__)
120+
__version_info__ = tuple(map(int, _m.groups())) if _m else tuple()
121+
122+
118123
del get_versions
119124

120125
_log = logging.getLogger(__name__)

0 commit comments

Comments
 (0)