~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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)