From: Fred Drake Date: Mon, 27 Apr 1998 14:39:44 +0000 (+0000) Subject: parse150(): Simplify RE used to parse the message a little, taking advantage X-Git-Tag: v1.5.2a1~825 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9291d271fbc5f89496d3bc8366826b800984286e;p=python parse150(): Simplify RE used to parse the message a little, taking advantage of using re instead of regex. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 63903d0879..0c14c6b31a 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -486,8 +486,7 @@ def parse150(resp): global _150_re if _150_re is None: import re - _150_re = re.compile("150 .* \(([0-9][0-9]*) bytes\)", - re.IGNORECASE) + _150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORECASE) m = _150_re.match(resp) if m: return string.atoi(m.group(1))