wsh
2009-09-14 16:33:14 UTC
Hi, all
When I'm testing a package, some code is broken and I get the error
message "AttributeError: 'module' object has no attribute
'interfaces'".
After I checked the code I found that there are some code in the
module, but the attribute does not exist. I checked the container with
print dir(container) and get following:
['__builtins__', '__doc__', '__file__', '__name__', '__path__']
But if I add following line in the __init__.py this problem can be
solved.
'constraints', 'i18n', 'interfaces']
Can anyone explain this?
Wang Shuhao
When I'm testing a package, some code is broken and I get the error
message "AttributeError: 'module' object has no attribute
'interfaces'".
After I checked the code I found that there are some code in the
from zope.app import container
When it try to reference the interfaces attribute of the containermodule, but the attribute does not exist. I checked the container with
print dir(container) and get following:
['__builtins__', '__doc__', '__file__', '__name__', '__path__']
But if I add following line in the __init__.py this problem can be
solved.
from zope.app import container
import zope.app.container.constraints
print dir(container)
['__builtins__', '__doc__', '__file__', '__name__', '__path__',import zope.app.container.constraints
print dir(container)
'constraints', 'i18n', 'interfaces']
Can anyone explain this?
Wang Shuhao