Skip to content

Remove unused imports and replace bare except clauses#60

Merged
Raibaz merged 1 commit intogoogleads:mainfrom
ZLeventer:cleanup/unused-imports-bare-excepts
Apr 24, 2026
Merged

Remove unused imports and replace bare except clauses#60
Raibaz merged 1 commit intogoogleads:mainfrom
ZLeventer:cleanup/unused-imports-bare-excepts

Conversation

@ZLeventer
Copy link
Copy Markdown
Contributor

Summary

  • Remove unused json and collections imports from update_references.py
  • Remove unused List import from get_resource_metadata.py (only Dict and Any are used)
  • Replace bare except: with except Exception: in mcp_header_interceptor.py (PEP 8 E722)

Details

All changes are mechanical cleanup — no behavior changes.

The bare except: clauses catch BaseException subclasses like KeyboardInterrupt and SystemExit, which should propagate. except Exception: is the standard Python practice per PEP 8.

Test plan

  • Existing unit tests pass (nox -s tests)
  • black -l 80 reports no formatting changes

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 24, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ZLeventer
Copy link
Copy Markdown
Contributor Author

I have signed the CLA.

- Remove unused `json` and `collections` imports from update_references.py
- Remove unused `List` import from get_resource_metadata.py
- Replace bare `except:` with `except Exception:` in mcp_header_interceptor.py
  (PEP 8 E722)
@ZLeventer ZLeventer force-pushed the cleanup/unused-imports-bare-excepts branch from 292851f to 07f9bf1 Compare April 24, 2026 01:33
@Raibaz Raibaz self-requested a review April 24, 2026 06:54
@Raibaz Raibaz merged commit 67867f5 into googleads:main Apr 24, 2026
8 checks passed
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.

2 participants