summaryrefslogtreecommitdiffstats
path: root/Lib/email/base64MIME.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-05-09 03:55:11 (GMT)
committerBarry Warsaw <barry@python.org>2004-05-09 03:55:11 (GMT)
commit24f79762a10bdadcf8383e5a94acf5346810d4d5 (patch)
tree2cefd9ed86b17e1bd4f3eaeecbfabbeb4f591acb /Lib/email/base64MIME.py
parent235c8eba62f1ecfb5beb1be0f692de3a07ef4ab1 (diff)
downloadcpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.zip
cpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.tar.gz
cpython-24f79762a10bdadcf8383e5a94acf5346810d4d5.tar.bz2
Update to Python 2.3, getting rid of backward compatiblity crud.
Diffstat (limited to 'Lib/email/base64MIME.py')
-rw-r--r--Lib/email/base64MIME.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/Lib/email/base64MIME.py b/Lib/email/base64MIME.py
index a247773..af85949 100644
--- a/Lib/email/base64MIME.py
+++ b/Lib/email/base64MIME.py
@@ -27,13 +27,6 @@ import re
from binascii import b2a_base64, a2b_base64
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'
EMPTYSTRING = ''
@@ -41,12 +34,6 @@ EMPTYSTRING = ''
# See also Charset.py
MISC_LEN = 7
-try:
- True, False
-except NameError:
- True = 1
- False = 0
-
# Helpers
@@ -100,7 +87,7 @@ def header_encode(header, charset='iso-8859-1', keep_eols=False,
# length, after the RFC chrome is added in.
base64ed = []
max_encoded = maxlinelen - len(charset) - MISC_LEN
- max_unencoded = _floordiv(max_encoded * 3, 4)
+ max_unencoded = max_encoded * 3 // 4
for i in range(0, len(header), max_unencoded):
base64ed.append(b2a_base64(header[i:i+max_unencoded]))
@@ -141,7 +128,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL):
s = fix_eols(s)
encvec = []
- max_unencoded = _floordiv(maxlinelen * 3, 4)
+ max_unencoded = maxlinelen * 3 // 4
for i in range(0, len(s), max_unencoded):
# BAW: should encode() inherit b2a_base64()'s dubious behavior in
# adding a newline to the encoded string?