Re: Trellis throws an error related to metaclass in python 2.6.5
Christopher Stelma <[email protected]> Wed, 29 Sep 2010 17:30:18 -0400
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <[email protected]> |
After seeing same error and the update to DecoratorTools in response, I applied a slightly different fix(?) for the problem. Instead of killing the ABCMeta methods in the definition of classy_class, in the three methods of classy, I replaced references to "type" with "super(classy_class, classy_class)". This lets ABCMeta.__new__ run when ABCMeta is the base class to do whatever setup is necessary, and skips straight back to type.__new__ when not. I'm not using any ABC's (directly), so is there any specific reason to disable it for classy sublclasses? On Thu, May 6, 2010 at 2:25 AM, Peter Damoc <[email protected]> wrote: > It works! Thanks P.J. ! > > (I did a manual checkout and setup.py install) > > I still get 2 deprecation warnings: > > C:\Python26\lib\site-packages\trellis-0.7a3_dev_r2610-py2.6.egg\peak\events\trellis.py:4: > DeprecationWarning: the sets module is deprecated > C:\Python26\lib\site-packages\trellis-0.7a3_dev_r2610-py2.6.egg\peak\events\trellis.py:509: > DeprecationWarning: object.__new__() takes no parameters > > But I guess that's OK for now. :) > > Keep up the good work! > Peter > > On Wed, May 5, 2010 at 9:11 PM, P.J. Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote: >> FYI, I've updated the SVN versions of Trellis and DecoratorTools to try to >> fix this problem. Use: >> >> easy_install svn://svn.eby-sarna.com/svnroot/DecoratorTools/ >> easy_install svn://svn.eby-sarna.com/svnroot/Trellis/ >> >> to get the updated versions. (Note: you'll need a Subversion client >> installed on your PATH.) Please let me know if these updated versions fix >> the problem. Thanks. >> >> At 03:39 PM 5/5/2010 +0300, Peter Damoc wrote: >>> >>> This is the relevant part of the traceback: >>> >>> >>> from peak.events import trellis >>> File >>> "C:\Python26\lib\site-packages\trellis-0.7a2-py2.6.egg\peak\events\trellis.py", >>> line 1231, in <module> >>> class List(UserList.UserList, Component): >>> File "C:\Python26\lib\abc.py", line 79, in __new__ >>> cls = super(ABCMeta, mcls).__new__(mcls, name, bases, namespace) >>> TypeError: Error when calling the metaclass bases >>> metaclass conflict: the metaclass of a derived class must be a >>> (non-strict) subclass of the metaclasses of all its bases >>> >>> >>> I've installed Trellis via easy_install.exe >>> >>> What can I do to get past this error? >>> I've searched the net and found something about peak.utils.Meta but I >>> don't know how to get that installed on my machine. The peak package >>> seams to be 5 years old and throws an error about vcvarsall.bat >>> >>> >>> Thank you in advance. >>> Peter >>> >>> -- >>> There is NO FATE, we are the creators. >>> blog: http://damoc.ro/ >>> _______________________________________________ >>> PEAK mailing list >>> [email protected] >>> http://www.eby-sarna.com/mailman/listinfo/peak >> >> > > > > -- > There is NO FATE, we are the creators. > blog: http://damoc.ro/ > _______________________________________________ > PEAK mailing list > [email protected] > http://www.eby-sarna.com/mailman/listinfo/peak > -- Christopher Stelma Digsby Developer - digsby.com [email protected]