-
Notifications
You must be signed in to change notification settings - Fork 263
fix: replace 11 bare except clauses with except Exception #444
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 all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -75,7 +75,7 @@ def connect_to_new_process(self, fds): | |||||
| try: | ||||||
| reduction.sendfds(client, allfds) | ||||||
| return parent_r, parent_w | ||||||
| except: | ||||||
| except Exception: | ||||||
|
||||||
| except Exception: | |
| except BaseException: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -333,7 +333,7 @@ def _bootstrap(self): | |
| sys.stderr.write(str(exc.args[0]) + '\n') | ||
| _maybe_flush(sys.stderr) | ||
| exitcode = 0 if isinstance(exc.args[0], str) else 1 | ||
| except: | ||
| except Exception: | ||
| exitcode = 1 | ||
| if not util.error('Process %s', self.name, exc_info=True): | ||
|
Comment on lines
+336
to
338
|
||
| import traceback | ||
|
|
||
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.
This
exceptensuresov.cancel()runs if the wait/write fails. Withexcept Exception,KeyboardInterrupt/SystemExitduring the wait will bypass cancellation, potentially leaving an overlapped I/O pending and leaking resources. Useexcept BaseExceptionfor the cancel-and-reraise pattern here.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.
can you please cross check this suggestion?