Skip to content

Fix bare except clauses in _pp.py: use except Exception - #101

Open
koteshyelamati wants to merge 1 commit into
uqfoundation:masterfrom
koteshyelamati:master
Open

Fix bare except clauses in _pp.py: use except Exception#101
koteshyelamati wants to merge 1 commit into
uqfoundation:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Fix 7 bare except: clauses in ppft/_pp.py that catch BaseException (including SystemExit, KeyboardInterrupt, GeneratorExit), replacing them with except Exception:.

Affected methods:

  • RWorker.connect() (line 219): network send errors
  • Server.__init__ stats check (line 539): time query errors
  • Server._connect1() (line 617): connection errors
  • Server._submit() (line 694): thread start errors
  • Server._run_local() (line 746): local task execution errors
  • Server._run_remote() (line 781): remote task execution errors
  • Worker cleanup (line 853): process kill errors

Bare except: clauses are bad practice (PEP 8 / flake8 E722) because they silently swallow KeyboardInterrupt and SystemExit, making programs impossible to interrupt cleanly.

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

Successfully merging this pull request may close these issues.

1 participant