Commit 0162aa21 authored by binji's avatar binji Committed by Commit bot

[NaCl SDK] Update fancy_urllib for Python 2.7.9

Python 2.7.9 adds an additional parameter to the HTTPSHandler.do_open function.
This function is overriden in fancy_urllib and called externally. This causes
the SDK updater to fail with a Python traceback. This CL fixes the calling
signature of the overriden do_open function.

BUG=452137
R=sbc@chromium.org

Review URL: https://codereview.chromium.org/874393004

Cr-Commit-Position: refs/heads/master@{#313176}
parent 48739c79
......@@ -24,3 +24,8 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Local Modifications:
- Python 2.7.9 adds an additional parameter to urllib2.HTTPSHandler.do_open. I
modified FancyHTTPSHandler.do_open to take this parameter and forward it to
the super function.
......@@ -329,7 +329,7 @@ class FancyProxyHandler(urllib2.ProxyHandler):
class FancyHTTPSHandler(urllib2.HTTPSHandler):
"""An HTTPSHandler that works with CONNECT-enabled proxies."""
def do_open(self, http_class, req):
def do_open(self, http_class, req, **kwargs):
# Intentionally very specific so as to opt for false negatives
# rather than false positives.
try:
......@@ -339,7 +339,8 @@ class FancyHTTPSHandler(urllib2.HTTPSHandler):
req._key_file,
req._cert_file,
req._ca_certs),
req)
req,
**kwargs)
except urllib2.URLError, url_error:
try:
import ssl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment