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

[revamp] The revamp branch always prints the ToolchainCL object after running #452

Closed
inclement opened this issue Sep 12, 2015 · 2 comments

Comments

@inclement
Copy link
Member

As per the title, the revamp branch always prints the ToolchainCL object after running. For instance, the output of p4a clean_all is:

[INFO]:    This python-for-android revamp is an experimental alpha release!
[INFO]:    It should work (mostly), but you may experience missing features or bugs.
<pythonforandroid.toolchain.ToolchainCL object at 0x7f9e4f461e50>

I'm opening an issue here because I have no idea why. Maybe it can be a simple issue for someone to fix.

@inclement inclement changed the title The revamp branch always prints the ToolchainCL object after running [revamp] The revamp branch always prints the ToolchainCL object after running Sep 12, 2015
@str4d
Copy link
Contributor

str4d commented Sep 12, 2015

The reason is that you have the console_scripts entry point pointing at a class, rather than a function. setuptools generates a shim for each entry point that calls its corresponding function and then passes the returned value to sys.exit(). Because the entry point is a class, sys.exit() is passed the value returned by ToolchainCL(), which is the ToolchainCL object. sys.exit() then takes the non-None value as an error message and prints it.

The fix is to move most of ToolchainCL.__init__() to some main() function, and set that as the console_scripts entry point.

@inclement
Copy link
Member Author

Thanks a lot, I've fixed it now. That's been annoying me for ages!

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

No branches or pull requests

2 participants