From: Eric S. Raymond Date: Fri, 9 Feb 2001 10:14:53 +0000 (+0000) Subject: Aha. We can remove he string import after all by using ValueError. X-Git-Tag: v2.1b1~460 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d87603e3e6f8b5cd1fbab14bbe455cd7603ec8b;p=python Aha. We can remove he string import after all by using ValueError. --- diff --git a/Lib/smtplib.py b/Lib/smtplib.py index b9c7f51ec6..1af406883a 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)