Skip to content

Better error message on pyexec(Main, "1+1") #383

Closed
@LilithHafner

Description

@LilithHafner
julia> pyexec(Main, "1+1")
ERROR: UndefVarError: `globals_` not defined
Stacktrace:
 [1] _pyeval_args(globals::String, locals::Nothing)
   @ PythonCall ~/.julia/packages/PythonCall/qTEA1/src/concrete/code.jl:12
 [2] pyexec(::Type{Nothing}, code::Module, globals::String, locals::Nothing)
   @ PythonCall ~/.julia/packages/PythonCall/qTEA1/src/concrete/code.jl:97
 [3] pyexec(code::Module, globals::String, locals::Nothing)
   @ PythonCall ~/.julia/packages/PythonCall/qTEA1/src/concrete/code.jl:103
 [4] pyexec(code::Module, globals::String)
   @ PythonCall ~/.julia/packages/PythonCall/qTEA1/src/concrete/code.jl:103
 [5] top-level scope
   @ REPL[8]:1

I think this should probably be a method error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions