Commits

Yuya Nishihara committed 6923441

thread: remove compatibility layer of ui.promptchoice for hg 2.6

Introduced in 7b66785810b2.

Comments (0)

Files changed (1)

tortoisehg/hgqt/thread.py

 import urllib2, urllib
 import socket
 import errno
-import inspect
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
         return self.sig.prompt(msg, default)
 
     def promptchoice(self, prompt, default=0):
+        if not self.interactive(): return default
         parts = prompt.split('$$')
         msg = parts[0].rstrip(' ')
         choices = [p.strip(' ') for p in parts[1:]]
-        return self._promptchoice(msg, choices, default)
-
-    def _promptchoice(self, msg, choices, default=0):
-        if not self.interactive(): return default
         return self.sig.promptchoice(msg, choices, default)
 
-    if len(inspect.getargspec(uimod.ui.promptchoice)[0]) > 3:
-        promptchoice = _promptchoice  # hg<2.7
-
     def getpass(self, prompt=None, default=None):
         return self.sig.getpass(prompt or _('password: '), default)