Use if instead of assert to check for twisted ftp patch

This commit is contained in:
david-sarah 2010-01-26 17:55:29 -08:00
parent 7d32fafc44
commit 100548257a
1 changed files with 2 additions and 1 deletions

View File

@ -289,7 +289,8 @@ class FTPServer(service.MultiService):
# make sure we're using a patched Twisted that uses IWriteFile.close:
# see docs/frontends/FTP-and-SFTP.txt and
# http://twistedmatrix.com/trac/ticket/3462 for details.
assert "close" in ftp.IWriteFile.names(), "your twisted is lacking a vital patch, see docs/frontends/FTP-and-SFTP.txt"
if "close" not in ftp.IWriteFile.names():
raise AssertionError("your twisted is lacking a vital patch, see docs/frontends/FTP-and-SFTP.txt")
r = Dispatcher(client)
p = portal.Portal(r)