Revision: 8042
Author: russblau
Date: 2010-03-27 19:29:29 +0000 (Sat, 27 Mar 2010)
Log Message:
-----------
Remove unnecessary lock.
Modified Paths:
--------------
branches/rewrite/pywikibot/userinterfaces/terminal_interface.py
Modified: branches/rewrite/pywikibot/userinterfaces/terminal_interface.py
===================================================================
--- branches/rewrite/pywikibot/userinterfaces/terminal_interface.py 2010-03-26 18:32:27
UTC (rev 8041)
+++ branches/rewrite/pywikibot/userinterfaces/terminal_interface.py 2010-03-27 19:29:29
UTC (rev 8042)
@@ -205,23 +205,17 @@
answer = ''
- # While we're waiting for user input,
- # we don't want terminal writes from other Threads
- self.writelock.acquire()
- try:
- # loop until the user entered a valid choice
- while True:
- prompt = '%s (%s)' % (question, ', '.join(options))
+ # loop until the user entered a valid choice
+ while True:
+ prompt = '%s (%s)' % (question, ', '.join(options))
- # it's okay to enter input with the lock, RLock is reentrant.
- answer = self.input(prompt)
- if answer.lower() in hotkeys or answer.upper() in hotkeys:
- break
- elif default and answer=='': # empty string entered
- answer = default
- break
- finally:
- self.writelock.release()
+ # it's okay to enter input with the lock, RLock is reentrant.
+ answer = self.input(prompt)
+ if answer.lower() in hotkeys or answer.upper() in hotkeys:
+ break
+ elif default and answer=='': # empty string entered
+ answer = default
+ break
return answer
def editText(self, text, jumpIndex = None, highlight = None):
Show replies by date