File tree 1 file changed +1
-7
lines changed
py/selenium/webdriver/firefox
1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -276,17 +276,11 @@ def parse_manifest_json(content):
276
276
277
277
try :
278
278
if zipfile .is_zipfile (addon_path ):
279
- # Bug 944361 - We cannot use 'with' together with zipFile because
280
- # it will cause an exception thrown in Python 2.6.
281
- # TODO: use with statement when Python 2.x is no longer supported
282
- try :
283
- compressed_file = zipfile .ZipFile (addon_path , "r" )
279
+ with zipfile .ZipFile (addon_path , "r" ) as compressed_file :
284
280
if "manifest.json" in compressed_file .namelist ():
285
281
return parse_manifest_json (compressed_file .read ("manifest.json" ))
286
282
287
283
manifest = compressed_file .read ("install.rdf" )
288
- finally :
289
- compressed_file .close ()
290
284
elif os .path .isdir (addon_path ):
291
285
manifest_json_filename = os .path .join (addon_path , "manifest.json" )
292
286
if os .path .exists (manifest_json_filename ):
You can’t perform that action at this time.
0 commit comments