@@ -520,7 +520,7 @@ def __init__(
520
520
socket_keepalive_options = None ,
521
521
socket_type = 0 ,
522
522
retry_on_timeout = False ,
523
- retry_on_error = [] ,
523
+ retry_on_error = SENTINEL ,
524
524
encoding = "utf-8" ,
525
525
encoding_errors = "strict" ,
526
526
decode_responses = False ,
@@ -552,6 +552,8 @@ def __init__(
552
552
self .socket_keepalive_options = socket_keepalive_options or {}
553
553
self .socket_type = socket_type
554
554
self .retry_on_timeout = retry_on_timeout
555
+ if retry_on_error is SENTINEL :
556
+ retry_on_error = []
555
557
if retry_on_timeout :
556
558
# Add TimeoutError to the errors list to retry on
557
559
retry_on_error .append (TimeoutError )
@@ -1071,7 +1073,7 @@ def __init__(
1071
1073
encoding_errors = "strict" ,
1072
1074
decode_responses = False ,
1073
1075
retry_on_timeout = False ,
1074
- retry_on_error = [] ,
1076
+ retry_on_error = SENTINEL ,
1075
1077
parser_class = DefaultParser ,
1076
1078
socket_read_size = 65536 ,
1077
1079
health_check_interval = 0 ,
@@ -1094,6 +1096,8 @@ def __init__(
1094
1096
self .password = password
1095
1097
self .socket_timeout = socket_timeout
1096
1098
self .retry_on_timeout = retry_on_timeout
1099
+ if retry_on_error is SENTINEL :
1100
+ retry_on_error = []
1097
1101
if retry_on_timeout :
1098
1102
# Add TimeoutError to the errors list to retry on
1099
1103
retry_on_error .append (TimeoutError )
0 commit comments