]> granicus.if.org Git - python/commitdiff
Closes SF patch 553277. Per GvR, reverting to original patch -- the way to
authorRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 05:53:51 +0000 (05:53 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 12 May 2002 05:53:51 +0000 (05:53 +0000)
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.

Lib/ftplib.py

index ebc88df3b5af56f56b41e178f625af035c352768..2ccfbcbffc79ed60202ed9ca9b10152917f25a01 100644 (file)
@@ -392,7 +392,7 @@ class FTP:
         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')