@@ -84,8 +84,7 @@ def _lenenc_int(i):
84
84
return b"\xfe " + struct .pack ("<Q" , i )
85
85
else :
86
86
raise ValueError (
87
- "Encoding %x is larger than %x - no representation in LengthEncodedInteger"
88
- % (i , (1 << 64 ))
87
+ f"Encoding { i :x} is larger than { 1 << 64 :x} - no representation in LengthEncodedInteger"
89
88
)
90
89
91
90
@@ -999,9 +998,8 @@ def _process_auth(self, plugin_name, auth_packet):
999
998
if plugin_name != b"dialog" :
1000
999
raise err .OperationalError (
1001
1000
CR .CR_AUTH_PLUGIN_CANNOT_LOAD ,
1002
- "Authentication plugin '%s'"
1003
- " not loaded: - %r missing authenticate method"
1004
- % (plugin_name , type (handler )),
1001
+ f"Authentication plugin '{ plugin_name } '"
1002
+ f" not loaded: - { type (handler )!r} missing authenticate method" ,
1005
1003
)
1006
1004
if plugin_name == b"caching_sha2_password" :
1007
1005
return _auth .caching_sha2_password_auth (self , auth_packet )
@@ -1037,16 +1035,14 @@ def _process_auth(self, plugin_name, auth_packet):
1037
1035
except AttributeError :
1038
1036
raise err .OperationalError (
1039
1037
CR .CR_AUTH_PLUGIN_CANNOT_LOAD ,
1040
- "Authentication plugin '%s'"
1041
- " not loaded: - %r missing prompt method"
1042
- % (plugin_name , handler ),
1038
+ f"Authentication plugin '{ plugin_name } '"
1039
+ f" not loaded: - { handler !r} missing prompt method" ,
1043
1040
)
1044
1041
except TypeError :
1045
1042
raise err .OperationalError (
1046
1043
CR .CR_AUTH_PLUGIN_ERR ,
1047
- "Authentication plugin '%s'"
1048
- " %r didn't respond with string. Returned '%r' to prompt %r"
1049
- % (plugin_name , handler , resp , prompt ),
1044
+ f"Authentication plugin '{ plugin_name } '"
1045
+ f" { handler !r} didn't respond with string. Returned '{ resp !r} ' to prompt { prompt !r} " ,
1050
1046
)
1051
1047
else :
1052
1048
raise err .OperationalError (
@@ -1079,9 +1075,8 @@ def _get_auth_plugin_handler(self, plugin_name):
1079
1075
except TypeError :
1080
1076
raise err .OperationalError (
1081
1077
CR .CR_AUTH_PLUGIN_CANNOT_LOAD ,
1082
- "Authentication plugin '%s'"
1083
- " not loaded: - %r cannot be constructed with connection object"
1084
- % (plugin_name , plugin_class ),
1078
+ f"Authentication plugin '{ plugin_name } '"
1079
+ f" not loaded: - { plugin_class !r} cannot be constructed with connection object" ,
1085
1080
)
1086
1081
else :
1087
1082
handler = None
0 commit comments