[Checkins] SVN: zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt Paper over different exception type raised under Python3.
Tres Seaver
tseaver at palladion.com
Fri Nov 19 09:51:43 EST 2010
Log message for revision 118497:
Paper over different exception type raised under Python3.
Changed:
U zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt
-=-
Modified: zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt
===================================================================
--- zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt 2010-11-19 14:50:37 UTC (rev 118496)
+++ zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt 2010-11-19 14:51:42 UTC (rev 118497)
@@ -65,21 +65,17 @@
The message's attributes are considered part of the immutable message
object. They cannot be changed once the message id is created:
- >>> robot.domain = "planetexpress"
- Traceback (most recent call last):
- ...
- TypeError: readonly attribute
+ >>> def _assertReadonlyAttribute(thing, attrname, value):
+ ... try:
+ ... setattr(thing, attrname, value)
+ ... except Exception, e:
+ ... assert str(e) == 'readonly attribute'
+ ... else:
+ ... raise AssertionError("Assigned to read-only attribute")
+ >>> _assertReadonlyAttribute(robot, 'domain', "planetexpress")
+ >>> _assertReadonlyAttribute(robot, 'default', u"${name} is not a robot.")
+ >>> _assertReadonlyAttribute(robot, 'mapping', {u'name': u'Bender'})
- >>> robot.default = u"${name} is not a robot."
- Traceback (most recent call last):
- ...
- TypeError: readonly attribute
-
- >>> robot.mapping = {u'name': u'Bender'}
- Traceback (most recent call last):
- ...
- TypeError: readonly attribute
-
If you need to change their information, you'll have to make a new
message id object:
More information about the checkins
mailing list