Commit d9dca6ce authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #553277: Accept callbacks that are callable, not callbacks that are true.

parent 6d12ea88
...@@ -392,7 +392,7 @@ class FTP: ...@@ -392,7 +392,7 @@ class FTP:
The callback function (2nd argument) is called for each line, The callback function (2nd argument) is called for each line,
with trailing CRLF stripped. This creates a new port for you. with trailing CRLF stripped. This creates a new port for you.
print_line() is the default callback.''' print_line() is the default callback.'''
if not callback: callback = print_line if not callable(callback): callback = print_line
resp = self.sendcmd('TYPE A') resp = self.sendcmd('TYPE A')
conn = self.transfercmd(cmd) conn = self.transfercmd(cmd)
fp = conn.makefile('rb') fp = conn.makefile('rb')
......
...@@ -226,6 +226,7 @@ John Interrante ...@@ -226,6 +226,7 @@ John Interrante
Ben Jackson Ben Jackson
Paul Jackson Paul Jackson
David Jacobs David Jacobs
Geert Jansen
Jack Jansen Jack Jansen
Bill Janssen Bill Janssen
Drew Jenkins Drew Jenkins
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment