Skip to content

Commit 7936b1f

Browse files
committed
Code optimization and refactoring
1 parent 23fcb65 commit 7936b1f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_anything(self):
7272
reload(sys) # noqa: F821
7373
sys.setdefaultencoding("utf8")
7474
selenium4 = False
75-
if sys.version_info[0] == 3 and sys.version_info[1] >= 7:
75+
if sys.version_info >= (3, 7):
7676
selenium4 = True
7777

7878

seleniumbase/fixtures/page_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This module contains useful utility methods.
33
"""
44
import codecs
5+
import os
56
import re
67
import requests
78

@@ -247,7 +248,8 @@ def _download_file_to(file_url, destination_folder, new_file_name=None):
247248
else:
248249
file_name = file_url.split("/")[-1]
249250
r = requests.get(file_url)
250-
with open(destination_folder + "/" + file_name, "wb") as code:
251+
file_path = os.path.join(destination_folder, file_name)
252+
with open(file_path, "wb") as code:
251253
code.write(r.content)
252254

253255

0 commit comments

Comments
 (0)