@@ -3267,29 +3267,25 @@ def _badwriteretry(
3267
3267
# set buffer size to the minimum of send and receive buffers
3268
3268
buffer_size = min (sndbuf , rcvbuf ) // 2
3269
3269
3270
- try :
3271
- # --- Main Test Flow ---
3272
- # _attempt_want_write_error() terminates the test
3273
- # if WantWriteError is not triggered
3274
- # The function also returns the message that triggered
3275
- # the WantWriteError so that when we attempt a retry
3276
- # we can ensure a different buffer location is allocated
3277
- # to a the new message we will send for the retry.
3278
- _ = self ._attempt_want_write_error (client , buffer_size )
3279
-
3280
- # proceed with draining so that a retry has a chance to succeed
3281
- self ._drain_server_buffers (server , server_socket )
3282
-
3283
- # now attempt the moving buffer retry
3284
- result = self ._perform_moving_buffer_test (
3285
- client , buffer_size , want_bad_retry
3286
- )
3287
- except Exception as e : # pragma: no cover
3288
- pytest .fail (f"Unexpected exception during test: { e } ." )
3289
- finally :
3290
- self ._shutdown_connections (
3291
- client , server , client_socket , server_socket
3292
- )
3270
+ # --- Main Test Flow ---
3271
+ # _attempt_want_write_error() terminates the test
3272
+ # if WantWriteError is not triggered
3273
+ # The function also returns the message that triggered
3274
+ # the WantWriteError so that when we attempt a retry
3275
+ # we can ensure a different buffer location is allocated
3276
+ # to a the new message we will send for the retry.
3277
+ _ = self ._attempt_want_write_error (client , buffer_size )
3278
+
3279
+ # proceed with draining so that a retry has a chance to succeed
3280
+ self ._drain_server_buffers (server , server_socket )
3281
+
3282
+ # now attempt the moving buffer retry
3283
+ result = self ._perform_moving_buffer_test (
3284
+ client , buffer_size , want_bad_retry
3285
+ )
3286
+ self ._shutdown_connections (
3287
+ client , server , client_socket , server_socket
3288
+ )
3293
3289
3294
3290
return result
3295
3291
0 commit comments