Using event.is_set to be compatible with Python2.6

Fixes #227
This commit is contained in:
Strahinja Val Markovic 2013-04-03 19:14:46 -07:00
parent 36815d7ccc
commit a75c92bb6a

View File

@ -105,7 +105,10 @@ class JediCompleter( Completer ):
def WaitAndClear( event, timeout=None ):
flag_is_set = event.wait( timeout )
if flag_is_set:
event.clear()
return flag_is_set
# We can't just do flag_is_set = event.wait( timeout ) because that breaks on
# Python 2.6
event.wait( timeout )
flag_is_set = event.is_set()
if flag_is_set:
event.clear()
return flag_is_set