summaryrefslogtreecommitdiff
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-04-27 14:39:44 +0000
committerFred Drake <fdrake@acm.org>1998-04-27 14:39:44 +0000
commit972c93c965801b0d377cf69293727b50b8655869 (patch)
treee7df28045e8277e1d80dd4c672f891842cc46d98 /Lib/ftplib.py
parentee36457e211eaf8fd4a7ebfc4cf37d6c587c89b6 (diff)
downloadcpython-972c93c965801b0d377cf69293727b50b8655869.tar.gz
parse150(): Simplify RE used to parse the message a little, taking advantage
of using re instead of regex.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py3
1 files changed, 1 insertions, 2 deletions
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))