mirror of https://github.com/python/cpython
Fix call to ModuleScanner from GUI search interface.
Fix handling of unbound top-level methods.
This commit is contained in:
parent
47f11ce591
commit
6dcfa3884d
18
Lib/pydoc.py
18
Lib/pydoc.py
|
@ -580,8 +580,8 @@ TT { font-family: lucida console, lucida typewriter, courier }
|
||||||
note = ''
|
note = ''
|
||||||
skipdocs = 0
|
skipdocs = 0
|
||||||
if inspect.ismethod(object):
|
if inspect.ismethod(object):
|
||||||
|
imclass = object.im_class
|
||||||
if cl:
|
if cl:
|
||||||
imclass = object.im_class
|
|
||||||
if imclass is not cl:
|
if imclass is not cl:
|
||||||
url = '%s.html#%s-%s' % (
|
url = '%s.html#%s-%s' % (
|
||||||
imclass.__module__, imclass.__name__, name)
|
imclass.__module__, imclass.__name__, name)
|
||||||
|
@ -589,9 +589,10 @@ TT { font-family: lucida console, lucida typewriter, courier }
|
||||||
url, classname(imclass, mod))
|
url, classname(imclass, mod))
|
||||||
skipdocs = 1
|
skipdocs = 1
|
||||||
else:
|
else:
|
||||||
note = (object.im_self and
|
inst = object.im_self
|
||||||
' method of %s instance' + object.im_self.__class__ or
|
note = (inst and
|
||||||
' unbound %s method' % object.im_class.__name__)
|
' method of %s instance' % classname(inst.__class__, mod) or
|
||||||
|
' unbound %s method' % classname(imclass, mod))
|
||||||
object = object.im_func
|
object = object.im_func
|
||||||
|
|
||||||
if name == realname:
|
if name == realname:
|
||||||
|
@ -847,9 +848,10 @@ class TextDoc(Doc):
|
||||||
note = ' from ' + classname(imclass, mod)
|
note = ' from ' + classname(imclass, mod)
|
||||||
skipdocs = 1
|
skipdocs = 1
|
||||||
else:
|
else:
|
||||||
note = (object.im_self and
|
inst = object.im_self
|
||||||
' method of %s instance' + object.im_self.__class__ or
|
note = (inst and
|
||||||
' unbound %s method' % classname(imclass, mod))
|
' method of %s instance' % classname(inst.__class__, mod) or
|
||||||
|
' unbound %s method' % classname(imclass, mod))
|
||||||
object = object.im_func
|
object = object.im_func
|
||||||
|
|
||||||
if name == realname:
|
if name == realname:
|
||||||
|
@ -1699,7 +1701,7 @@ def gui():
|
||||||
self.scanner.quit = 1
|
self.scanner.quit = 1
|
||||||
self.scanner = ModuleScanner()
|
self.scanner = ModuleScanner()
|
||||||
threading.Thread(target=self.scanner.run,
|
threading.Thread(target=self.scanner.run,
|
||||||
args=(key, self.update, self.done)).start()
|
args=(self.update, key, self.done)).start()
|
||||||
|
|
||||||
def update(self, path, modname, desc):
|
def update(self, path, modname, desc):
|
||||||
if modname[-9:] == '.__init__':
|
if modname[-9:] == '.__init__':
|
||||||
|
|
Loading…
Reference in New Issue