Skip to content

Commit 415aacb

Browse files
committed
Update format for parsing files
1 parent 358a25d commit 415aacb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

seleniumbase/utilities/selenium_ide/objectify.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,9 +1274,8 @@ def main(shell_command):
12741274
"Expecting: %s\n"
12751275
% (seleniumbase_file, expected_arg))
12761276

1277-
f = open(seleniumbase_file, 'r')
1278-
all_code = f.read()
1279-
f.close()
1277+
with open(seleniumbase_file, 'r', encoding='utf-8') as f:
1278+
all_code = f.read()
12801279
if "def test_" not in all_code:
12811280
raise Exception("\n\n`%s` is not a valid SeleniumBase unittest file!\n"
12821281
"\nExpecting: %s\n"

0 commit comments

Comments
 (0)