Skip to content

Commit

Permalink
"Resolve unsoundness caught by pytype --strict-none-binding.
Browse files Browse the repository at this point in the history
See go/pytype-releases#strict-none-binding and go/pytype-smarter-optional. In
short, pytype was previously more permissive when variables were initialized to
None but may have been re-assigned later. This change improves pytype's ability
to catch unsoundness in the affected files.

PiperOrigin-RevId: 567950912
  • Loading branch information
DeepMind authored and copybara-github committed Sep 24, 2023
1 parent 49fd98e commit 1f83b7f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def load_state(
* If an error occurred during the snapshot loading process, the status
will be `ERROR` and the `error_message` field will be filled.
"""
assert self._snapshot_stub is not None
snapshot_name = request.args.get('snapshot_name', _DEFAULT_SNAPSHOT_NAME)
snapshot_list = self._snapshot_stub.ListSnapshots(
snapshot_service_pb2.SnapshotFilter(
Expand Down Expand Up @@ -317,6 +318,8 @@ def save_state(
* If an error occurred during the snapshot saving process, the status
will be `ERROR` and the `error_message` field will be filled.
"""
assert self._snapshot_stub is not None

snapshot_name = request.args.get('snapshot_name', _DEFAULT_SNAPSHOT_NAME)
snapshot_result = self._snapshot_stub.SaveSnapshot(
snapshot_service_pb2.SnapshotPackage(snapshot_id=snapshot_name)
Expand Down

0 comments on commit 1f83b7f

Please sign in to comment.