[Python-checkins] python/dist/src/Lib/email base64MIME.py,1.3,1.4
bwarsaw@users.sourceforge.net
bwarsaw@users.sourceforge.net
Sun, 02 Jun 2002 12:08:34 -0700
Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv26448/email
Modified Files:
base64MIME.py
Log Message:
header_encode(), encode(): Use _floordiv() from the appropriate
compatibility module.
Index: base64MIME.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/base64MIME.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** base64MIME.py 29 May 2002 20:38:21 -0000 1.3
--- base64MIME.py 2 Jun 2002 19:08:31 -0000 1.4
***************
*** 28,31 ****
--- 28,38 ----
from email.Utils import fix_eols
+ try:
+ from email._compat22 import _floordiv
+ except SyntaxError:
+ # Python 2.1 spells integer division differently
+ from email._compat21 import _floordiv
+
+
CRLF = '\r\n'
NL = '\n'
***************
*** 88,92 ****
base64ed = []
max_encoded = maxlinelen - len(charset) - MISC_LEN
! max_unencoded = max_encoded * 3 // 4
# BAW: Ben's original code used a step of max_unencoded, but I think it
--- 95,99 ----
base64ed = []
max_encoded = maxlinelen - len(charset) - MISC_LEN
! max_unencoded = _floordiv(max_encoded * 3, 4)
# BAW: Ben's original code used a step of max_unencoded, but I think it
***************
*** 132,136 ****
encvec = []
! max_unencoded = maxlinelen * 3 // 4
for i in range(0, len(s), max_unencoded):
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
--- 139,143 ----
encvec = []
! max_unencoded = _floordiv(maxlinelen * 3, 4)
for i in range(0, len(s), max_unencoded):
# BAW: should encode() inherit b2a_base64()'s dubious behavior in