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

Bug #1560617: in pyclbr, return full module name not only for classes,

but also for functions.
 (backport from rev. 52069)
üst 9c9a9ab6
......@@ -172,7 +172,7 @@ def _readmodule(module, path, inpackage=None):
# else it's a nested def
else:
# it's a function
dict[meth_name] = Function(module, meth_name, file, lineno)
dict[meth_name] = Function(fullmodule, meth_name, file, lineno)
stack.append((None, thisindent)) # Marker for nested fns
elif token == 'class':
lineno, thisindent = start
......
......@@ -93,6 +93,9 @@ class PyclbrTest(TestCase):
py_item = getattr(module, name)
if isinstance(value, pyclbr.Function):
self.assert_(isinstance(py_item, (FunctionType, BuiltinFunctionType)))
if py_item.__module__ != moduleName:
continue # skip functions that came from somewhere else
self.assertEquals(py_item.__module__, value.module)
else:
self.failUnless(isinstance(py_item, (ClassType, type)))
if py_item.__module__ != moduleName:
......
......@@ -41,6 +41,9 @@ Extension Modules
Library
-------
- Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
- Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash.
......
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