@@ -384,7 +384,7 @@ def addheader(self, key, value, prefix=0,
384384 # 2.2 urllib2 doesn't normalize header case
385385 self ._http_hdrs .append ((key .capitalize (), value ))
386386 else :
387- for i in range (1 , len (lines )):
387+ for i in xrange (1 , len (lines )):
388388 lines [i ] = " " + lines [i ].strip ()
389389 value = "\r \n " .join (lines ) + "\r \n "
390390 line = key .title () + ": " + value
@@ -1129,7 +1129,7 @@ def _ParseFileEx(file, base_uri,
11291129 forms , labels , id_to_labels , backwards_compat )
11301130 form ._urlparse = _urlparse
11311131 form ._urlunparse = _urlunparse
1132- for ii in range (len (controls )):
1132+ for ii in xrange (len (controls )):
11331133 type , name , attrs = controls [ii ]
11341134 # index=ii*10 allows ImageControl to return multiple ordered pairs
11351135 form .new_control (
@@ -2020,7 +2020,7 @@ def add_to_form(self, form):
20202020 # always count nameless elements as separate controls
20212021 Control .add_to_form (self , form )
20222022 else :
2023- for ii in range (len (form .controls )- 1 , - 1 , - 1 ):
2023+ for ii in xrange (len (form .controls )- 1 , - 1 , - 1 ):
20242024 control = form .controls [ii ]
20252025 if control .name == self .name and control .type == self .type :
20262026 if control ._closed :
@@ -2151,7 +2151,7 @@ def _multiple_set_value(self, value):
21512151 names [nn ] = 1
21522152 for name , count in names .items ():
21532153 on , off = self ._get_items (name , count )
2154- for i in range (count ):
2154+ for i in xrange (count ):
21552155 if on :
21562156 item = on [0 ]
21572157 del on [0 ]
@@ -2850,7 +2850,7 @@ def new_control(self, type, name, attrs,
28502850 control = klass (type , name , a , index )
28512851
28522852 if type == "select" and len (attrs ) == 1 :
2853- for ii in range (len (self .controls )- 1 , - 1 , - 1 ):
2853+ for ii in xrange (len (self .controls )- 1 , - 1 , - 1 ):
28542854 ctl = self .controls [ii ]
28552855 if ctl .type == "select" :
28562856 ctl .close_control ()
@@ -3333,7 +3333,7 @@ def _pairs_and_controls(self):
33333333 control_index is the index of the control in self.controls
33343334 """
33353335 pairs = []
3336- for control_index in range (len (self .controls )):
3336+ for control_index in xrange (len (self .controls )):
33373337 control = self .controls [control_index ]
33383338 for ii , key , val in control ._totally_ordered_pairs ():
33393339 pairs .append ((ii , key , val , control_index ))
0 commit comments