Skip to content

Fix bare except clauses in test/test_outputfilter.py and test/test_wsgi.py#1530

Open
koteshyelamati wants to merge 2 commits into
bottlepy:masterfrom
koteshyelamati:master
Open

Fix bare except clauses in test/test_outputfilter.py and test/test_wsgi.py#1530
koteshyelamati wants to merge 2 commits into
bottlepy:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Replace bare except: with except AttributeError: in two test files.

Both files use the same pattern: try header.get_all('Set-Cookie', '') and fall back to header.get(...) if the method doesn't exist. The get_all method is absent on some HTTP header implementations, raising AttributeError. Using except AttributeError: makes this intent explicit and avoids accidentally swallowing KeyboardInterrupt or SystemExit.

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