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

Hy sys.executable may confuses python library #1753

Closed
TristanCacqueray opened this issue Mar 10, 2019 · 1 comment · Fixed by #2337
Closed

Hy sys.executable may confuses python library #1753

TristanCacqueray opened this issue Mar 10, 2019 · 1 comment · Fixed by #2337
Labels

Comments

@TristanCacqueray
Copy link
Contributor

For example this library: https://github.com/glumpy/glumpy/blob/master/glumpy/ext/glfw.py#L139
uses "sys.executable -c" with python code, which is not working with hy and results in a import error.

Perhaps the -c argument could check the command's dialect and fallback to hy.sys_executable if it's not hylang? Alternatively doing (setv sys.executable hy.sys_executable) fixes this issue.

@Kodiologist
Copy link
Member

Perhaps the -c argument could check the command's dialect and fallback to hy.sys_executable if it's not hylang?

That seems error-prone. I think we have to decide whether sys.executable will be Hy or Python and stick with it. Past experience (#329, #459) seems to indicate that setting it to Hy is helpful. On the other hand, the linked example in Glumpy doesn't make any sense to me. Why not just run that code directly as part of the function instead of farming it out to a subprocess?

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

Successfully merging a pull request may close this issue.

3 participants