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

Build scripts have syntax errors in python #118

Open
Athwale opened this issue Sep 19, 2024 · 4 comments
Open

Build scripts have syntax errors in python #118

Athwale opened this issue Sep 19, 2024 · 4 comments

Comments

@Athwale
Copy link

Athwale commented Sep 19, 2024

File "/home/other/Soyes/TWRP/build/vendor/omni/build/tools/roomservice.py", line 109
except IOError, ES.ParseError:
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

File "/home/other/Soyes/TWRP/build/vendor/omni/build/tools/roomservice.py", line 166
except IOError, ES.ParseError:
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

Easily fixed by putting () around the exceptions on line 109 and 166.

@Athwale
Copy link
Author

Athwale commented Sep 24, 2024

If you are going to ask me to submit a PR, tell me which repo it is.

@CaptainThrowback
Copy link

The Python issues were always dependent on what Python version is used on the build box. So I'm not positive that making the change you suggest would break anything or not.

But according to the error message, the issue is in vendor_omni, isn't it?

@Athwale
Copy link
Author

Athwale commented Sep 25, 2024

According to the path it is in vendor/omni.

The rest of the script uses print() which is a python3 style of print.
Looking at it the script seems to be a hybrid that should run on both but does not. Since there is this up top:
try:
# For python3
import urllib.request
except ImportError:
# For python2
import imp
import urllib2
urllib = imp.new_module('urllib')
urllib.request = urllib2

@afaneh92
Copy link

afaneh92 commented Oct 11, 2024

  • Ubuntu 22.04+, run "which python" to see the correct path
    sudo ln -nsf /usr/bin/python2 /usr/bin/python
    or
    sudo ln -nsf /usr/bin/python2 /usr/local/bin/python

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

3 participants