Skip to content

Commit 1955e38

Browse files
committed
use VersionParsing package to parse Matplotlib version number
1 parent ac1827e commit 1955e38

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ PyCall 1.6.2
33
Colors
44
LaTeXStrings
55
Compat 0.32.0
6+
VersionParsing

src/init.jl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# PyPlot initialization — the hardest part is finding a working backend.
2+
using VersionParsing
23

34
###########################################################################
45

@@ -173,19 +174,9 @@ function __init__()
173174
copy!(matplotlib, pyimport_conda("matplotlib", "matplotlib"))
174175
mvers = matplotlib[:__version__]
175176
global version = try
176-
convert(VersionNumber, mvers)
177+
vparse(mvers)
177178
catch
178-
parts = split(mvers,'.')
179-
try
180-
# handle mvers == aa.bb.cc.xx by dropping .xx, see #448
181-
convert(VersionNumber, join(parts[1:min(3,length(parts))], '.'))
182-
catch
183-
if !isempty(parts) && all(isdigit, parts[1])
184-
convert(VersionNumber, parts[1])
185-
else
186-
v"0.0" # fallback
187-
end
188-
end
179+
v"0.0.0" # fallback
189180
end
190181

191182
backend_gui = find_backend(matplotlib)

0 commit comments

Comments
 (0)