Skip to content

Commit 2c780f9

Browse files
committed
py: Fixing Python 2 incompatibility. Fixes issue 8274
1 parent 5ac0fba commit 2c780f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: py/selenium/webdriver/firefox/firefox_profile.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@
2727

2828
try:
2929
from cStringIO import StringIO as BytesIO
30-
bytes = str
31-
str = basestring
3230
except ImportError:
3331
from io import BytesIO
3432

33+
try:
34+
basestring
35+
except NameError: # Python 3.x
36+
basestring = str
37+
3538
from xml.dom import minidom
3639
from selenium.webdriver.common.proxy import ProxyType
3740
from selenium.common.exceptions import WebDriverException

0 commit comments

Comments
 (0)