[Checkins] SVN: zope.i18nmessageid/branches/regebro-python3/src/zope/i18nmessageid/messages.txt Paper over different exception type raised under Python3.

Lennart Regebro regebro at gmail.com
Fri Nov 19 10:22:38 EST 2010


Hi, can you explain this?

After this change, the tests now break under Python 3.1, while they
worked before...

On Fri, Nov 19, 2010 at 15:51, Tres Seaver <tseaver at palladion.com> wrote:
> 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:
>
>
> _______________________________________________
> checkins mailing list
> checkins at zope.org
> https://mail.zope.org/mailman/listinfo/checkins
>


More information about the checkins mailing list