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

_patch_application_sources breaks from __future__ imports #35

Closed
LilyFoote opened this issue Sep 15, 2013 · 1 comment
Closed

_patch_application_sources breaks from __future__ imports #35

LilyFoote opened this issue Sep 15, 2013 · 1 comment
Labels

Comments

@LilyFoote
Copy link
Contributor

The method _patch_application_sources in buildozer/__init__.py prepends main.py with:

import sys, os; sys.path = [os.path.join(os.path.dirname(__file__), "_applibs")] + sys.path

This causes a syntax error if the original first line started with a from __future__ import statement, e.g.:

from __future__ import division
SyntaxError: ('from __future__ imports must occur at the beginning of the file', ('/home/ian/life/.buildozer/android/app/main.py', 2, None, 'from __future__ import division\n'))
@tshirtman
Copy link
Member

As discussed, that's indeed an issue, and the correct solution in the current context is non-trivial, would be better to change how the packages are added, maybe adding the content of _applibs to the shipped pythonpackages?

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

No branches or pull requests

2 participants