Skip to content

Commit 00dc345

Browse files
committed
fix error handling for panua_is_licensed
* Checked panua licensing query mechanism again locally
1 parent 4beeea8 commit 00dc345

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/Pardiso.jl

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,28 +123,20 @@ function panua_is_licensed()
123123
elseif PARDISO_LICENSED[]
124124
return true
125125
end
126+
# Suppress unwanted output from pardisoinit, which prints license info to stdout
126127
redirect_stdout(devnull) do
127128
try
128129
ps = PardisoSolver(;loadchecks = false)
129-
pardisoinit(ps) #errors if unlicensed
130+
pardisoinit(ps) # errors if unlicensed
130131
PARDISO_LICENSED[] = true
131132
return true
132133
catch e
133-
if isa(e, ErrorException) && occursin(r"(?i)licen[cs]e|unlicensed|not licensed", e.msg)
134+
if isa(e, PardisoException)
134135
return false
135136
else
136137
rethrow(e)
137138
end
138-
try
139-
ps = PardisoSolver(;loadchecks = false)
140-
# Suppress unwanted output from pardisoinit, which prints license info to stdout
141-
redirect_stdout(devnull) do
142-
pardisoinit(ps) # errors if unlicensed
143139
end
144-
PARDISO_LICENSED[] = true
145-
return true
146-
catch e
147-
return false
148140
end
149141
end
150142

0 commit comments

Comments
 (0)