@@ -88,9 +88,7 @@ def _validate_collections_param(collections):
8888 raise ValueError ("Duplicate value." )
8989 collection_names .add (collection_name )
9090 except ValueError as e :
91- raise ValueError (
92- "`collections` parameter, position {i}: {e}" .format (i = i , e = str (e ))
93- )
91+ raise ValueError (f"`collections` parameter, position { i } : { str (e )} " )
9492
9593
9694class _ConfigReader :
@@ -135,7 +133,7 @@ def parse(self):
135133 dict (_parse_options (self ._parser .items (section ), section = section )),
136134 )
137135 except ValueError as e :
138- raise exceptions .UserError ('Section "{}": {}' . format ( section , str (e )) )
136+ raise exceptions .UserError (f 'Section "{ section } ": { str (e )} ' )
139137
140138 _validate_general_section (self ._general )
141139 if getattr (self ._file , "name" , None ):
@@ -152,7 +150,7 @@ def _parse_options(items, section=None):
152150 try :
153151 yield key , json .loads (value )
154152 except ValueError as e :
155- raise ValueError ('Section "{}", option "{}": {}' . format ( section , key , e ) )
153+ raise ValueError (f 'Section "{ section } ", option "{ key } ": { e } ' )
156154
157155
158156class Config :
@@ -190,9 +188,7 @@ def from_filename_or_environment(cls, fname=None):
190188 with open (fname ) as f :
191189 return cls .from_fileobject (f )
192190 except Exception as e :
193- raise exceptions .UserError (
194- "Error during reading config {}: {}" .format (fname , e )
195- )
191+ raise exceptions .UserError (f"Error during reading config { fname } : { e } " )
196192
197193 def get_storage_args (self , storage_name ):
198194 try :
0 commit comments