Skip to content

fix: use specific exceptions and idiomatic None comparison#69

Open
haosenwang1018 wants to merge 1 commit intobytetriper:mainfrom
haosenwang1018:fix/bare-excepts-and-none-comparison
Open

fix: use specific exceptions and idiomatic None comparison#69
haosenwang1018 wants to merge 1 commit intobytetriper:mainfrom
haosenwang1018:fix/bare-excepts-and-none-comparison

Conversation

@haosenwang1018
Copy link

Changes

  1. src/stage2/transport/integrators.py: except:except KeyError: for dict lookup
  2. src/stage2/transport/transport.py: == Noneis None per PEP 8
  3. src/train.py: except:except Exception: for torch.compile fallback

Bare except: catches SystemExit/KeyboardInterrupt, preventing clean shutdown.

- integrators.py: except KeyError (dict lookup)
- transport.py: 'is None' instead of '== None' (PEP 8)
- train.py: except Exception for torch.compile fallback
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