@@ -972,10 +972,10 @@ def _clean_options(self, options, engine):
972
972
elif engine not in ("python" , "python-fwf" ):
973
973
# wait until regex engine integrated
974
974
fallback_reason = (
975
- "the 'c' engine does not support"
976
- " regex separators (separators > 1 char and"
977
- r" different from '\s+' are"
978
- " interpreted as regex)"
975
+ "the 'c' engine does not support "
976
+ "regex separators (separators > 1 char and "
977
+ r"different from '\s+' are "
978
+ "interpreted as regex)"
979
979
)
980
980
engine = "python"
981
981
elif delim_whitespace :
@@ -990,9 +990,9 @@ def _clean_options(self, options, engine):
990
990
encodeable = False
991
991
if not encodeable and engine not in ("python" , "python-fwf" ):
992
992
fallback_reason = (
993
- "the separator encoded in {encoding}"
994
- " is > 1 char long, and the 'c' engine"
995
- " does not support such separators" .format (encoding = encoding )
993
+ "the separator encoded in {encoding} "
994
+ "is > 1 char long, and the 'c' engine "
995
+ "does not support such separators" .format (encoding = encoding )
996
996
)
997
997
engine = "python"
998
998
@@ -1021,21 +1021,19 @@ def _clean_options(self, options, engine):
1021
1021
if "python" in engine :
1022
1022
for arg in _python_unsupported :
1023
1023
if fallback_reason and result [arg ] != _c_parser_defaults [arg ]:
1024
- msg = (
1025
- "Falling back to the 'python' engine because"
1026
- " {reason}, but this causes {option!r} to be"
1027
- " ignored as it is not supported by the 'python'"
1028
- " engine."
1029
- ).format (reason = fallback_reason , option = arg )
1030
- raise ValueError (msg )
1024
+ raise ValueError (
1025
+ f"Falling back to the 'python' engine because "
1026
+ f"{ fallback_reason } , but this causes { repr (arg )} to be "
1027
+ f"ignored as it is not supported by the 'python' engine."
1028
+ )
1031
1029
del result [arg ]
1032
1030
1033
1031
if fallback_reason :
1034
1032
warnings .warn (
1035
1033
(
1036
- "Falling back to the 'python' engine because"
1037
- " {0}; you can avoid this warning by specifying"
1038
- " engine='python'."
1034
+ "Falling back to the 'python' engine because "
1035
+ "{0}; you can avoid this warning by specifying "
1036
+ "engine='python'."
1039
1037
).format (fallback_reason ),
1040
1038
ParserWarning ,
1041
1039
stacklevel = 5 ,
@@ -1056,8 +1054,8 @@ def _clean_options(self, options, engine):
1056
1054
depr_default = _deprecated_defaults [arg ]
1057
1055
1058
1056
msg = (
1059
- "The '{ arg}' argument has been deprecated "
1060
- "and will be removed in a future version.". format ( arg = arg )
1057
+ f "The { repr ( arg ) } argument has been deprecated and will be "
1058
+ f" removed in a future version."
1061
1059
)
1062
1060
1063
1061
if result .get (arg , depr_default ) != depr_default :
@@ -1081,9 +1079,8 @@ def _clean_options(self, options, engine):
1081
1079
if converters is not None :
1082
1080
if not isinstance (converters , dict ):
1083
1081
raise TypeError (
1084
- "Type converters must be a dict or"
1085
- " subclass, input was "
1086
- "a {0!r}" .format (type (converters ).__name__ )
1082
+ f"Type converters must be a dict or subclass, "
1083
+ f"input was a { repr (type (converters ).__name__ )} "
1087
1084
)
1088
1085
else :
1089
1086
converters = {}
0 commit comments