Fix for a nevow/formless/annotate/zope.interface bug
from nevow import tags as T
File "/usr/lib/python2.6/dist-packages/nevow/__init__.py", line 143, in
load(basic_adapters)
File "/usr/lib/python2.6/dist-packages/nevow/__init__.py", line 29, in load
registerAdapter(_namedAnyWithBuiltinTranslation(a),
File "/usr/lib/python2.6/dist-packages/nevow/util.py", line 183, in _namedAnyWithBuiltinTranslation
return namedAny(name)
File "/home/drewp/projects-local/ffg/eggs/Twisted-10.0.0-py2.6-linux-x86_64.egg/twisted/python/reflect.py", line 464, in namedAny
topLevelPackage = _importAndCheckStack(trialname)
File "/home/drewp/projects-local/ffg/eggs/Twisted-10.0.0-py2.6-linux-x86_64.egg/twisted/python/reflect.py", line 400, in _importAndCheckStack
return __import__(importName)
File "/usr/lib/python2.6/dist-packages/formless/__init__.py", line 9, in
from formless.annotate import *
File "/usr/lib/python2.6/dist-packages/formless/annotate.py", line 851, in
TypedInterface = MetaTypedInterface('TypedInterface', (InterfaceClass('TypedInterface'), ), {})
File "/usr/lib/python2.6/dist-packages/formless/annotate.py", line 731, in __new__
_typedInterfaceMetadata[cls, '__id__'] = nextId()
File "/home/drewp/projects-local/ffg/eggs/zope.interface-3.6.4-py2.6-linux-x86_64.egg/zope/interface/interface.py", line 685, in __hash__
return hash((self.__name__, self.__module__))
AttributeError: 'MetaTypedInterface' object has no attribute '__name__'
That's an annoying error I just started getting, maybe with my Ubuntu 11.04 upgrade, or maybe from something else. Here is a workaround:
from zope.interface.interface import InterfaceClass
def __hash__(self):
return hash((getattr(self, __name__, ''), self.__module__))
InterfaceClass.__hash__ = __hash__
- New comment
Atom feed of this blog