Skip to content

Commit

Permalink
Closes SF patch 553277. Per GvR, reverting to original patch -- the w…
Browse files Browse the repository at this point in the history
…ay to

test if 'callable' has not been supplied is to test for None instead of
False.  The previous correction to 'if callable()' was wrong because an unusable
callback would be ignored rather than raising an exception.
  • Loading branch information
rhettinger committed May 12, 2002
1 parent 9415309 commit e874fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/ftplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def retrlines(self, cmd, callback = None):
The callback function (2nd argument) is called for each line,
with trailing CRLF stripped. This creates a new port for you.
print_line() is the default callback.'''
if not callable(callback): callback = print_line
if callback is None: callback = print_line
resp = self.sendcmd('TYPE A')
conn = self.transfercmd(cmd)
fp = conn.makefile('rb')
Expand Down

0 comments on commit e874fc3

Please sign in to comment.