Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
LilithHafner opened this issue Oct 19, 2023 · 1 comment · Fixed by #386
Closed

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

LilithHafner opened this issue Oct 19, 2023 · 1 comment · Fixed by #386
Labels
enhancement New feature or request

Comments

@LilithHafner
Copy link
Contributor

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.

@LilithHafner LilithHafner added the enhancement New feature or request label Oct 19, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented Oct 19, 2023

ArgumentError("globals must be a module or a Python dict")
is missing a throw(...)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants