@@ -195,8 +195,7 @@ def _read_existing_userjs(self, userjs):
195
195
self .default_preferences [matches .group (1 )] = json .loads (matches .group (2 ))
196
196
except Exception :
197
197
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 )} "
200
199
)
201
200
except Exception :
202
201
# 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):
233
232
# determine the addon id
234
233
addon_details = self ._addon_details (addon )
235
234
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 } "
237
236
238
237
# copy the addon to the profile
239
238
addon_path = os .path .join (self .extensionsDir , addon_id )
@@ -300,7 +299,7 @@ def parse_manifest_json(content):
300
299
}
301
300
302
301
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 } " )
304
303
305
304
try :
306
305
if zipfile .is_zipfile (addon_path ):
@@ -324,7 +323,7 @@ def parse_manifest_json(content):
324
323
with open (os .path .join (addon_path , "install.rdf" ), encoding = "utf-8" ) as f :
325
324
manifest = f .read ()
326
325
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 } " )
328
327
except (OSError , KeyError ) as e :
329
328
raise AddonFormatError (str (e ), sys .exc_info ()[2 ])
330
329
0 commit comments