Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9291d27

Browse files
committed
parse150(): Simplify RE used to parse the message a little, taking advantage
of using re instead of regex.
1 parent 8c8e814 commit 9291d27

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/ftplib.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,7 @@ def parse150(resp):
486486
global _150_re
487487
if _150_re is None:
488488
import re
489-
_150_re = re.compile("150 .* \(([0-9][0-9]*) bytes\)",
490-
re.IGNORECASE)
489+
_150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORECASE)
491490
m = _150_re.match(resp)
492491
if m:
493492
return string.atoi(m.group(1))

0 commit comments

Comments
 (0)