@@ -195,8 +195,7 @@ def _read_existing_userjs(self, userjs):
195195 self .default_preferences [matches .group (1 )] = json .loads (matches .group (2 ))
196196 except Exception :
197197 warnings .warn (
198- "(skipping) failed to json.loads existing preference: %s" % matches .group (1 )
199- + matches .group (2 )
198+ f"(skipping) failed to json.loads existing preference: { matches .group (1 ) + matches .group (2 )} "
200199 )
201200 except Exception :
202201 # The profile given hasn't had any changes made, i.e no users.js
@@ -233,7 +232,7 @@ def _install_extension(self, addon, unpack=True):
233232 # determine the addon id
234233 addon_details = self ._addon_details (addon )
235234 addon_id = addon_details .get ("id" )
236- assert addon_id , "The addon id could not be found: %s" % addon
235+ assert addon_id , f "The addon id could not be found: { addon } "
237236
238237 # copy the addon to the profile
239238 addon_path = os .path .join (self .extensionsDir , addon_id )
@@ -300,7 +299,7 @@ def parse_manifest_json(content):
300299 }
301300
302301 if not os .path .exists (addon_path ):
303- raise OSError ("Add-on path does not exist: %s" % addon_path )
302+ raise OSError (f "Add-on path does not exist: { addon_path } " )
304303
305304 try :
306305 if zipfile .is_zipfile (addon_path ):
@@ -324,7 +323,7 @@ def parse_manifest_json(content):
324323 with open (os .path .join (addon_path , "install.rdf" ), encoding = "utf-8" ) as f :
325324 manifest = f .read ()
326325 else :
327- raise OSError ("Add-on path is neither an XPI nor a directory: %s" % addon_path )
326+ raise OSError (f "Add-on path is neither an XPI nor a directory: { addon_path } " )
328327 except (OSError , KeyError ) as e :
329328 raise AddonFormatError (str (e ), sys .exc_info ()[2 ])
330329
0 commit comments