From bda568d0d18ccdb78ab443c44ec10348cf1aa794 Mon Sep 17 00:00:00 2001 From: Luke Inman-Semerau Date: Thu, 12 Dec 2013 13:09:35 -0800 Subject: [PATCH] some py3 compatibility --- py/selenium/webdriver/remote/remote_connection.py | 3 ++- .../selenium/webdriver/common/executing_javascript_tests.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/remote/remote_connection.py b/py/selenium/webdriver/remote/remote_connection.py index de12508f909a5..b3e1d175d9c4a 100644 --- a/py/selenium/webdriver/remote/remote_connection.py +++ b/py/selenium/webdriver/remote/remote_connection.py @@ -409,7 +409,8 @@ def _request(self, url, data=None, method=None): HttpErrorHandler()) resp = opener.open(request) statuscode = resp.code - resp.getheader = lambda x: resp.headers.getheader(x) + if not hasattr(resp, 'getheader'): + resp.getheader = lambda x: resp.headers.getheader(x) data = resp.read() try: diff --git a/py/test/selenium/webdriver/common/executing_javascript_tests.py b/py/test/selenium/webdriver/common/executing_javascript_tests.py index 5061dc68f6e3f..8473d47287a1f 100644 --- a/py/test/selenium/webdriver/common/executing_javascript_tests.py +++ b/py/test/selenium/webdriver/common/executing_javascript_tests.py @@ -20,7 +20,7 @@ try: str = unicode -except ImportError: +except NameError: pass