Skip to content

close(::Figure) still broken #22

Closed
@IanButterworth

Description

@IanButterworth

@stevengj The fix for #21 didn't work I'm afraid.

On main cc633dd

julia> f = PythonPlot.figure(figsize = (6, 6), dpi = 100)
Figure(<py Figure size 600x600 with 0 Axes>)

julia> close(f)
ERROR: cannot convert this Python 'NoneType' to a Julia 'Int64'
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] macro expansion
   @ ~/.julia/packages/PythonCall/dsECZ/src/convert.jl:355 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/PythonCall/dsECZ/src/Py.jl:131 [inlined]
 [4] pyconvert(#unused#::Type{Int64}, x::PythonCall.Py)
   @ PythonCall ~/.julia/packages/PythonCall/dsECZ/src/convert.jl:370
 [5] plotclose(f::Figure)
   @ PythonPlot ~/.julia/packages/PythonPlot/oPo8Q/src/PythonPlot.jl:193
 [6] close(f::Figure)
   @ PythonPlot ~/.julia/packages/PythonPlot/oPo8Q/src/PythonPlot.jl:189
 [7] top-level scope
   @ REPL[4]:1

It would've been good for the fix to be made in a PR with a test added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions