-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replaced many exit(1)
s with exception raising
#1468
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
Conversation
8be3e16
to
ccb225a
Compare
I was wondering if |
@@ -58,8 +59,7 @@ def check_python_dependencies(): | |||
ok = False | |||
|
|||
if not ok: | |||
print('python-for-android is exiting due to the errors above.') | |||
exit(1) | |||
print('python-for-android is exiting due to the errors logged above') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be an error raised here? Or is this change intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally did, but actually this code is run before most of the build process (because it has to run before the imports) so I think it needs a different treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well but as it is, this seems to be a big change in behavior since the code flow just seems to resume. Is that intended? Maybe the exit
should be left in if a runtime error doesn't make sense here? Or will this problem of not ok
be evaluated again & properly dealt with later?
If you say it makes sense I'll take your word for it, I haven't looked at the followup code closely. it just seems like a potential trouble source breaking things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added the exit(1) back in with the previous comment, I missed that I'd accidentally removed it before so thanks for pointing it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, the removing line is gone now. Didn't see that 😆
03cddbb
to
c6deaa8
Compare
@AndreMiras Just rebased this to fix merge conflicts, any objections to merging it (if the tests pass)? |
Just to barge in, I have been eyeing this for a while and I think it's a really good code smell fix. Haven't commented so far since I haven't had the chance to test if it actually doesn't break stuff, but it looks like a thing really worth improving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haven't tested it 😬 but looks nice. and I think it's a really useful internal improvement
@@ -58,8 +59,7 @@ def check_python_dependencies(): | |||
ok = False | |||
|
|||
if not ok: | |||
print('python-for-android is exiting due to the errors above.') | |||
exit(1) | |||
print('python-for-android is exiting due to the errors logged above') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, the removing line is gone now. Didn't see that 😆
I also think it's a nice improvement, can't wait for it once the tests are passing indeed. We know the conditional build are now failing #1485 but the rest (e.g. linting) should be fixed before we can merge. |
Hi @inclement can you give me write access to your |
c6deaa8
to
6ed21b4
Compare
6ed21b4
to
bec18e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed rebase conflict, linter and unit tests, good to go
This both makes the code neater and will make it easier to test things.