summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 10:14:53 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 10:14:53 (GMT)
commit8d87603e3e6f8b5cd1fbab14bbe455cd7603ec8b (patch)
tree371f58db06965346c44acd3f042140a701923807 /Lib
parent18af564bef5e7dd05217b9704c3714d421f7d217 (diff)
downloadcpython-8d87603e3e6f8b5cd1fbab14bbe455cd7603ec8b.zip
cpython-8d87603e3e6f8b5cd1fbab14bbe455cd7603ec8b.tar.gz
cpython-8d87603e3e6f8b5cd1fbab14bbe455cd7603ec8b.tar.bz2
Aha. We can remove he string import after all by using ValueError.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/smtplib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index b9c7f51..1af4068 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -40,7 +40,6 @@ Example:
# This was modified from the Python 1.5 library HTTP lib.
import socket
-import string
import re
import rfc822
import types
@@ -209,7 +208,7 @@ class SMTP:
if i >= 0:
host, port = host[:i], host[i+1:]
try: port = int(port)
- except string.atoi_error:
+ except ValueError:
raise socket.error, "nonnumeric port"
if not port: port = SMTP_PORT
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)