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
Problems using a package #18
Comments
This seems to run fine for me. Can you run For reference look at the FILE part of this output:
|
Running Here
|
I shortened the not working example to
This doesn't work but the following works fine
|
It seems that I'm not 100% sure what the relationship between those two is, but if you can ensure that |
which is no problem for Python. There is no virtualenv in play, and I have only one Python 3 systemwide installed |
This is a regression in zxpy 1.4.1 and does not happen on zxpy 1.4.0. This is reproducible with the usage of venv just fine as well. It is most likely related to zxpy playing with locals |
Yup, you're right. I just realised I was testing on 1.4.0. Thanks @jack1142 |
Looking at the code, I wonder, why is class X:
__name__ = "__main__"
import toml
def main():
print(toml.__dir__())
if __name__ == '__main__':
main() |
@jack1142 it's because it seemed to work :P and it's also because I couldn't figure out how to extract the globals from the compiled module, and update them. Do you know how that can be done? |
I don't think that needs to be done? The globals don't exist in the compiled form, only the code that defines them does. They should only exist once they actually get declared at runtime and the compiled code runs once you use exec. Did you run into some issue when just doing this? exec(code, {'__name__': '__main__'}) |
@jack1142 IIRC yes, but let me try again |
@jack1142 alright that seems to work xD thanks about that @manfredlotz I'll be releasing a new patch with the fix and reply soon |
@manfredlotz Alright, try again after doing |
Yep, working fine now. You are really quick. Much appreciated. Thanks a lot @tusharsadhwani and @jack1142 . |
Hi there, the following simple script doesn't work
I get
The text was updated successfully, but these errors were encountered: