/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Andrew Bennetts
  • Date: 2008-11-27 06:29:56 UTC
  • mfrom: (3861 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3863.
  • Revision ID: andrew.bennetts@canonical.com-20081127062956-v0a19icwk85iosx4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
234
234
 
235
235
# Build the appropriate socket wrapper for ssl
236
236
try:
237
 
    import ssl # python 2.6
 
237
    # python 2.6 introduced a better ssl package
 
238
    import ssl
238
239
    _ssl_wrap_socket = ssl.wrap_socket
239
240
except ImportError:
 
241
    # python versions prior to 2.6 don't have ssl and ssl.wrap_socket instead
 
242
    # they use httplib.FakeSocket
240
243
    def _ssl_wrap_socket(sock, key_file, cert_file):
241
244
        ssl_sock = socket.ssl(sock, key_file, cert_file)
242
245
        return httplib.FakeSocket(sock, ssl_sock)