[Python-checkins] r52071 - in python/branches/release25-maint: Lib/pyclbr.py Lib/test/test_pyclbr.py Misc/NEWS
georg.brandl
python-checkins at python.org
Sat Sep 30 13:06:56 CEST 2006
Author: georg.brandl
Date: Sat Sep 30 13:06:55 2006
New Revision: 52071
Modified:
python/branches/release25-maint/Lib/pyclbr.py
python/branches/release25-maint/Lib/test/test_pyclbr.py
python/branches/release25-maint/Misc/NEWS
Log:
Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
(backport from rev. 52069)
Modified: python/branches/release25-maint/Lib/pyclbr.py
==============================================================================
--- python/branches/release25-maint/Lib/pyclbr.py (original)
+++ python/branches/release25-maint/Lib/pyclbr.py Sat Sep 30 13:06:55 2006
@@ -172,7 +172,7 @@
# 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
Modified: python/branches/release25-maint/Lib/test/test_pyclbr.py
==============================================================================
--- python/branches/release25-maint/Lib/test/test_pyclbr.py (original)
+++ python/branches/release25-maint/Lib/test/test_pyclbr.py Sat Sep 30 13:06:55 2006
@@ -93,6 +93,9 @@
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:
Modified: python/branches/release25-maint/Misc/NEWS
==============================================================================
--- python/branches/release25-maint/Misc/NEWS (original)
+++ python/branches/release25-maint/Misc/NEWS Sat Sep 30 13:06:55 2006
@@ -41,6 +41,9 @@
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.
More information about the Python-checkins
mailing list