Skip to content
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

feat: implement TRY301 #2113

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

karpa4o4
Copy link
Contributor

fn visit_stmt(&mut self, stmt: &'b Stmt) {
match stmt.node {
StmtKind::Raise { .. } => self.raises.push(stmt),
_ => visitor::walk_stmt(self, stmt),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we avoid recursing if we hit another try block?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, we might raise the same error multiple times for nested try blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@charliermarsh charliermarsh merged commit 58d5ac0 into astral-sh:main Jan 24, 2023
@karpa4o4 karpa4o4 deleted the feat/tryceratops-TRY301 branch January 24, 2023 13:40
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.

None yet

2 participants