Kaydet (Commit) afa4f485 authored tarafından Georg Brandl's avatar Georg Brandl

Patch #1194449: correctly detect unbound methods in pydoc.

 (backport from rev. 54365)
üst d6e73c17
...@@ -855,7 +855,7 @@ class HTMLDoc(Doc): ...@@ -855,7 +855,7 @@ class HTMLDoc(Doc):
if imclass is not cl: if imclass is not cl:
note = ' from ' + self.classlink(imclass, mod) note = ' from ' + self.classlink(imclass, mod)
else: else:
if object.im_self: if object.im_self is not None:
note = ' method of %s instance' % self.classlink( note = ' method of %s instance' % self.classlink(
object.im_self.__class__, mod) object.im_self.__class__, mod)
else: else:
...@@ -1226,7 +1226,7 @@ class TextDoc(Doc): ...@@ -1226,7 +1226,7 @@ class TextDoc(Doc):
if imclass is not cl: if imclass is not cl:
note = ' from ' + classname(imclass, mod) note = ' from ' + classname(imclass, mod)
else: else:
if object.im_self: if object.im_self is not None:
note = ' method of %s instance' % classname( note = ' method of %s instance' % classname(
object.im_self.__class__, mod) object.im_self.__class__, mod)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment