From: <bu...@us...> - 2009-08-30 13:28:00
|
Revision: 736 http://fail2ban.svn.sourceforge.net/fail2ban/?rev=736&view=rev Author: buanzo Date: 2009-08-30 13:27:52 +0000 (Sun, 30 Aug 2009) Log Message: ----------- added python version detection to asyncore.loop(use_poll=True|False) Modified Paths: -------------- branches/FAIL2BAN-0_8/server/asyncserver.py Modified: branches/FAIL2BAN-0_8/server/asyncserver.py =================================================================== --- branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 00:36:40 UTC (rev 735) +++ branches/FAIL2BAN-0_8/server/asyncserver.py 2009-08-30 13:27:52 UTC (rev 736) @@ -133,7 +133,12 @@ self.__init = True # TODO Add try..catch # There's a bug report for Python 2.6/3.0 that use_poll=True yields some 2.5 incompatibilities: - asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6. + if (sys.version_info[0] == 2 and sys.version_info[1] == 6) or (sys.version_info[0] == 3): # if python 2.6 or 3.*... + logSys.debug("Detected Python 2.6 or 3.*. asyncore.loop() not using poll") + asyncore.loop(use_poll = False) # fixes the "Unexpected communication problem" issue on Python 2.6 and 3.0 + else: + logSys.debug("NOT Python 2.6/3.* - asyncore.loop() using poll") + asyncore.loop(use_poll = True) ## # Stops the communication server. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |