-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[smart] rename the Group name to 'lwProcess' and optimize the error h… #10436
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,18 +35,21 @@ else: | |||||||||||||
| process_env['RTT_DEVICE'] = rtconfig.DEVICE | ||||||||||||||
|
|
||||||||||||||
| command = ["scons", "-C", vdso_arch] | ||||||||||||||
| clean_command = ["scons", "-C", vdso_arch, "--clean"] | ||||||||||||||
| if GetOption('clean'): | ||||||||||||||
| command = ["scons", "-C", vdso_arch, "--clean"] | ||||||||||||||
|
|
||||||||||||||
| if not GetOption('clean'): | ||||||||||||||
| try: | ||||||||||||||
| result = subprocess.run(command, env=process_env, check=True) | ||||||||||||||
| else: | ||||||||||||||
| result = subprocess.run(clean_command, env=process_env, check=True) | ||||||||||||||
| # generic error handle | ||||||||||||||
| except : | ||||||||||||||
| print('exec command: "%s" failed.' % ' '.join(command)) | ||||||||||||||
| exit(1) | ||||||||||||||
|
|
||||||||||||||
| if result.returncode == 0: | ||||||||||||||
| print("Command executed successfully") | ||||||||||||||
| else: | ||||||||||||||
| print("Command failed with exit code:", result.returncode) | ||||||||||||||
| exit(1) | ||||||||||||||
|
||||||||||||||
| if result.returncode == 0: | |
| print("Command executed successfully") | |
| else: | |
| print("Command failed with exit code:", result.returncode) | |
| exit(1) | |
| print("Command executed successfully") |
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.
Avoid using a bare
except:which also catches system-exiting exceptions. Catch specific errors (e.g.,except subprocess.CalledProcessError as e:) to prevent unintended behavior.