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

assert keyword do not work #1193

Closed
Fogapod opened this issue Dec 11, 2017 · 3 comments · Fixed by #1221
Closed

assert keyword do not work #1193

Fogapod opened this issue Dec 11, 2017 · 3 comments · Fixed by #1221

Comments

@Fogapod
Copy link
Contributor

Fogapod commented Dec 11, 2017

I saw this issue first and decided to check if this problem occurs in other kivy python implementations on Android. Assert did not work for me in apps builded with various versions of p4a (from old toolchain to 0.6.0)
Syntax assert False is ignored in any kivy app on Android (not sure for python3 builds though)
I assume the the problem is somewhere in the python build process

@tito
Copy link
Member

tito commented Dec 11, 2017

Because p4a ship compiled version (optimized?) of Python bytecode (-OO). This removes the assert and code behind __debug__. You can consider it as "release" code shipped into the APK.

Now that you mention it, i guess it would be nice to do that only for the actual release, and not debug mode.

@inclement ?

@inclement
Copy link
Member

That would make sense to me. I'm not sure the -OO affects the size much anyway.

@inclement
Copy link
Member

I made a PR at #1221 that should fix this, but haven't tested it yet other than to make sure the compiling works.

AndreMiras added a commit that referenced this issue Dec 14, 2018
Added --no-optimize-python option to remove -OO in sdl2 bootstrap, fixes #1193
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

Successfully merging a pull request may close this issue.

3 participants