~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-05-11 16:35:34 UTC
  • mfrom: (5848.2.2 2.4-uses-py26)
  • Revision ID: pqm@pqm.ubuntu.com-20110511163534-yz28ddqwa5cicukr
(jameinel) Finally break compatibility with python 2.4/5. bzr-2.4.0 will be
 officially only compatible with python2.6/7 (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        self.report_activity(len(s), 'read')
111
111
        return s
112
112
 
113
 
    # httplib in python 2.4 and 2.5 defines a SSLFile wrapper whose readline
114
 
    # method lacks the size parameter. python2.6 provides a proper ssl socket
115
 
    # and added it. python2.7 uses it, forcing us to provide it.
116
 
    if sys.version_info < (2, 6):
117
 
        def readline(self):
118
 
            s = self.filesock.readline()
119
 
            self.report_activity(len(s), 'read')
120
 
            return s
121
 
    else:
122
 
        def readline(self, size=-1):
123
 
            s = self.filesock.readline(size)
124
 
            self.report_activity(len(s), 'read')
125
 
            return s
 
113
    def readline(self, size=-1):
 
114
        s = self.filesock.readline(size)
 
115
        self.report_activity(len(s), 'read')
 
116
        return s
126
117
 
127
118
    def __getattr__(self, name):
128
119
        return getattr(self.filesock, name)