From 742cd24c029f1fe84d2a60f84e408c72bd3ed34d Mon Sep 17 00:00:00 2001 From: "Phillip J. Eby" Date: Tue, 18 Apr 2006 01:39:25 +0000 Subject: [PATCH] test_pyclbr goes nuts when a module contains code to try importing a class and provide a substitute if the import fails, because pyclbr sees the class definition. Changed to ignore such cases' base classes and methods, since they will not match. --- Lib/test/test_pyclbr.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index 87572ca038..d2f8c768f0 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -95,6 +95,9 @@ class PyclbrTest(TestCase): self.assert_(isinstance(py_item, (FunctionType, BuiltinFunctionType))) else: self.failUnless(isinstance(py_item, (ClassType, type))) + if py_item.__module__!=moduleName: + continue # skip classes that came from somewhere else + real_bases = [base.__name__ for base in py_item.__bases__] pyclbr_bases = [ getattr(base, 'name', base) for base in value.super ] -- 2.40.0