summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-04-27 14:39:44 (GMT)
committerFred Drake <fdrake@acm.org>1998-04-27 14:39:44 (GMT)
commit9291d271fbc5f89496d3bc8366826b800984286e (patch)
tree88b3b31457deb96ee0b59bd1406b75722656566c
parent8c8e8149929c3e10d79a6ead2f1b603e065e32d2 (diff)
downloadcpython-9291d271fbc5f89496d3bc8366826b800984286e.zip
cpython-9291d271fbc5f89496d3bc8366826b800984286e.tar.gz
cpython-9291d271fbc5f89496d3bc8366826b800984286e.tar.bz2
parse150(): Simplify RE used to parse the message a little, taking advantage
of using re instead of regex.
-rw-r--r--Lib/ftplib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 63903d0..0c14c6b 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))