Skip to content

Commit 940d944

Browse files
author
Christopher Doris
committed
better testing for missing attributes
1 parent bb16dd1 commit 940d944

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/julia.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pyjlrawtype(::Type{T}) where {T} = get!(PYJLRAWTYPES, T) do
294294
try
295295
return _o.__jl_wrap_result(pyjlraw(getproperty(o, k)))
296296
catch err
297-
if err isa ErrorException && occursin("has no field", err.msg)
297+
if (err isa UndefVarError) || (err isa ErrorException && occursin("has no field", err.msg))
298298
throw(PythonRuntimeError(st...))
299299
else
300300
rethrow()
@@ -318,7 +318,7 @@ pyjlrawtype(::Type{T}) where {T} = get!(PYJLRAWTYPES, T) do
318318
setproperty!(o, k, v)
319319
return pynone
320320
catch err
321-
if err isa ErrorException && occursin("has no field", err.msg)
321+
if (err isa UndefVarError) || (err isa ErrorException && occursin("has no field", err.msg))
322322
throw(PythonRuntimeError(st...))
323323
else
324324
rethrow()

0 commit comments

Comments
 (0)