[Python-checkins] python/dist/src/Lib/email Header.py,1.3,1.4
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Fri, 31 May 2002 22:49:19 -0700
Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv3679/email
Modified Files:
Header.py
Log Message:
The _compat modules now export _floordiv() instead of _intdiv2() for
better code reuse.
_split() Use _floordiv().
Index: Header.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Header.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Header.py 23 May 2002 15:15:29 -0000 1.3
--- Header.py 1 Jun 2002 05:49:17 -0000 1.4
***************
*** 10,17 ****
try:
! from email._compat22 import _intdiv2
except SyntaxError:
# Python 2.1 spells integer division differently
! from email._compat21 import _intdiv2
CRLFSPACE = '\r\n '
--- 10,17 ----
try:
! from email._compat22 import _floordiv
except SyntaxError:
# Python 2.1 spells integer division differently
! from email._compat21 import _floordiv
CRLFSPACE = '\r\n '
***************
*** 169,175 ****
return self._split(first, charset) + self._split(last, charset)
else:
! # Divide and conquer. BAW: halfway depends on integer division.
! # When porting to Python 2.2, use the // operator.
! halfway = _intdiv2(len(splittable))
first = charset.from_splittable(splittable[:halfway], 0)
last = charset.from_splittable(splittable[halfway:], 0)
--- 169,174 ----
return self._split(first, charset) + self._split(last, charset)
else:
! # Divide and conquer.
! halfway = _floordiv(len(splittable), 2)
first = charset.from_splittable(splittable[:halfway], 0)
last = charset.from_splittable(splittable[halfway:], 0)