--- a/RefactoringRope/CodeAssistClient.py Thu Nov 02 15:50:46 2017 +0100 +++ b/RefactoringRope/CodeAssistClient.py Sun Nov 05 13:19:52 2017 +0100 @@ -297,25 +297,28 @@ @rtype dictionary with keys "name", "argspec", "module" and "docstring" """ - objectFullname = '' - calltip = '' - argspec = '' - module = '' + objectFullname = "" + calltip = "" + argspec = "" + module = "" if cts: - cts = cts.replace('.__init__', '') - parenthesisPos = cts.find('(') - if parenthesisPos: + cts = cts.replace(".__init__", "") + parenthesisPos = cts.find("(") + if parenthesisPos != -1: objectFullname = cts[:parenthesisPos] objectName = objectFullname.split('.')[-1] cts = cts.replace(objectFullname, objectName) calltip = cts - if objectFullname and not objectFullname.startswith('self.'): + else: + objectFullname = cts + if objectFullname and not objectFullname.startswith("self."): if calltip: - argspecStart = calltip.find('(') + argspecStart = calltip.find("(") argspec = calltip[argspecStart:] - moduleEnd = objectFullname.rfind('.') - module = objectFullname[:moduleEnd] + + moduleEnd = objectFullname.rfind('.') + module = objectFullname[:moduleEnd] if not documentation and not calltip: return None