@@ -1959,14 +1959,19 @@ def __init__(self, name, type, clinic, *args):
1959
1959
self .name = name
1960
1960
self .type = type
1961
1961
self .clinic = clinic
1962
+ self .buffers = BufferSeries ()
1963
+
1962
1964
valid_types = ('buffer' , 'file' , 'suppress' )
1963
1965
if type not in valid_types :
1964
- fail ("Invalid destination type " + repr (type ) + " for " + name + " , must be " + ', ' .join (valid_types ))
1966
+ fail (
1967
+ f"Invalid destination type { type !r} for { name } , "
1968
+ f"must be { ', ' .join (valid_types )} "
1969
+ )
1965
1970
extra_arguments = 1 if
8000
type == "file" else 0
1966
1971
if len (args ) < extra_arguments :
1967
- fail ("Not enough arguments for destination " + name + " new " + type )
1972
+ fail (f "Not enough arguments for destination { name } new { type } " )
1968
1973
if len (args ) > extra_arguments :
1969
- fail ("Too many arguments for destination " + name + " new " + type )
1974
+ fail (f "Too many arguments for destination { name } new { type } " )
1970
1975
if type == 'file' :
1971
1976
d = {}
1972
1977
filename = clinic .filename
@@ -1979,8 +1984,6 @@ def __init__(self, name, type, clinic, *args):
1979
1984
d ['basename_root' ], d ['basename_extension' ] = os .path .splitext (filename )
1980
1985
self .filename = args [0 ].format_map (d )
1981
1986
1982
- self .buffers = BufferSeries ()
1983
-
1984
1987
def __repr__ (self ):
1985
1988
if self .type == 'file' :
1986
1989
file_repr = " " + repr (self .filename )
0 commit comments