File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
seleniumbase/utilities/selenium_ide Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,8 @@ def main():
51
51
uses_keys = False
52
52
uses_select = False
53
53
54
- f = open (webdriver_python_file , 'r' , encoding = 'utf-8' )
55
- all_code = f .read ()
56
- f .close ()
54
+ with open (webdriver_python_file , 'r' , encoding = 'utf-8' ) as f :
55
+ all_code = f .read ()
57
56
if "def test_" not in all_code :
58
57
raise Exception ("\n \n `%s` is not a valid Python unittest.TestCase "
59
58
"file!\n \n Expecting: %s\n \n "
Original file line number Diff line number Diff line change @@ -146,9 +146,8 @@ def scan_objects_file():
146
146
create_objects_file ()
147
147
148
148
page_selectors = {}
149
- f = open (PAGE_OBJECTS_FILE , 'r' )
150
- all_code = f .read ()
151
- f .close ()
149
+ with open (PAGE_OBJECTS_FILE , 'r' , encoding = 'utf-8' ) as f :
150
+ all_code = f .read ()
152
151
153
152
var_names = []
154
153
selectors = []
You can’t perform that action at this time.
0 commit comments