Cant declare classes in Scripts with 2.7 and Python 2.3
Bug #142731 reported by
Chris McDonough
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Fix Released
|
Medium
|
Evan Simpson |
Bug Description
Jamie Heilman reports:
In 2.3 you can no longer declare new classes in a Script object. It
> bitches about a lack of __name__ attribute. I haven't really had the
> time to look into it closely, but it does effect the examples shipped
> with zope, and actually its just a very useful thing to be able to do.
> Whatever this problem stems from, there will probably be more because
> of it.
To post a comment you must log in.
On zope-dev, Fred L. Drake, Jr. said:
"""
In Python 2.3.x, when a class is defined the __name__ of the
encompassing module is looked up. I suspect Python Scripts can be
fixed by defining __name__ in the globals dictionary in which the code is executed.
"""