~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge the fix in trunk

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
 
    def readline(self):
114
 
        # This should be readline(self, size=-1), but httplib in python 2.4 and
115
 
        #  2.5 defines a SSLFile wrapper whose readline method lacks the size
116
 
        #  parameter.  So until we drop support for 2.4 and 2.5 and since we
117
 
        #  don't *need* the size parameter we'll stay with readline(self)
118
 
        #  --  vila 20090209
119
 
        s = self.filesock.readline()
120
 
        self.report_activity(len(s), 'read')
121
 
        return s
 
113
    if sys.version < (2, 6):
 
114
        def readline(self):
 
115
            s = self.filesock.readline()
 
116
            self.report_activity(len(s), 'read')
 
117
            return s
 
118
    else:
 
119
        def readline(self, size=-1):
 
120
            s = self.filesock.readline(size)
 
121
            self.report_activity(len(s), 'read')
 
122
            return s
122
123
 
123
124
    def __getattr__(self, name):
124
125
        return getattr(self.filesock, name)