[Epydoc-commits] SF.net SVN: epydoc: [1727] trunk/epydoc/src/epydoc/apidoc.py
Brought to you by:
edloper
|
From: <ed...@us...> - 2008-02-16 04:51:01
|
Revision: 1727
http://epydoc.svn.sourceforge.net/epydoc/?rev=1727&view=rev
Author: edloper
Date: 2008-02-15 20:50:59 -0800 (Fri, 15 Feb 2008)
Log Message:
-----------
- In mro calculation: if there's an inconsistent base class hierarchy,
then print an error and recover using depth first search.
Modified Paths:
--------------
trunk/epydoc/src/epydoc/apidoc.py
Modified: trunk/epydoc/src/epydoc/apidoc.py
===================================================================
--- trunk/epydoc/src/epydoc/apidoc.py 2008-02-16 04:49:50 UTC (rev 1726)
+++ trunk/epydoc/src/epydoc/apidoc.py 2008-02-16 04:50:59 UTC (rev 1727)
@@ -1297,7 +1297,13 @@
def mro(self, warn_about_bad_bases=False):
if self.is_newstyle_class():
- return self._c3_mro(warn_about_bad_bases)
+ try:
+ return self._c3_mro(warn_about_bad_bases)
+ except ValueError, e: # (inconsistent hierarchy)
+ log.error('Error finding mro for %s: %s' %
+ (self.canonical_name, e))
+ # Better than nothing:
+ return self._dfs_bases([], set(), warn_about_bad_bases)
else:
return self._dfs_bases([], set(), warn_about_bad_bases)
@@ -1355,7 +1361,7 @@
nothead=[s for s in nonemptyseqs if cand in s[1:]]
if nothead: cand=None #reject candidate
else: break
- if not cand: raise "Inconsistent hierarchy"
+ if not cand: raise ValueError("Inconsistent hierarchy")
res.append(cand)
for seq in nonemptyseqs: # remove cand
if seq[0] == cand: del seq[0]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|