File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
py/selenium/webdriver/firefox Expand file tree Collapse file tree 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):
276276
277277 try :
278278 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 :
284280 if "manifest.json" in compressed_file .namelist ():
285281 return parse_manifest_json (compressed_file .read ("manifest.json" ))
286282
287283 manifest = compressed_file .read ("install.rdf" )
288- finally :
289- compressed_file .close ()
290284 elif os .path .isdir (addon_path ):
291285 manifest_json_filename = os .path .join (addon_path , "manifest.json" )
292286 if os .path .exists (manifest_json_filename ):
You can’t perform that action at this time.
0 commit comments