Problem
Bare except: clauses catch KeyboardInterrupt, SystemExit, and GeneratorExit in addition to intended exceptions. This prevents graceful shutdown and makes debugging harder.
Affected Files
pyhealth/metrics/ranking.py: except: should be except ImportError:
pyhealth/calib/predictionset/scrib/quicksearch.py: except: should be except ImportError:
pyhealth/datasets/base_dataset.py: two except: on queue.get(timeout=1) should catch queue.Empty
Proposed Fix
Replace each bare except: with the specific exception type it's intended to handle.
Problem
Bare
except:clauses catchKeyboardInterrupt,SystemExit, andGeneratorExitin addition to intended exceptions. This prevents graceful shutdown and makes debugging harder.Affected Files
pyhealth/metrics/ranking.py:except:should beexcept ImportError:pyhealth/calib/predictionset/scrib/quicksearch.py:except:should beexcept ImportError:pyhealth/datasets/base_dataset.py: twoexcept:onqueue.get(timeout=1)should catchqueue.EmptyProposed Fix
Replace each bare
except:with the specific exception type it's intended to handle.