[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/ Massive style cleanup: Move to new raise exception style; for motivation, see:

2005-08-30 Thread Benji York

Martijn Pieters wrote:

Log message for revision 38178:
  Massive style cleanup: Move to new raise exception style; for motivation, see:



Modified: Zope3/trunk/src/zope/app/workflow/stateful/definition.py
===
--- Zope3/trunk/src/zope/app/workflow/stateful/definition.py2005-08-30 
21:36:02 UTC (rev 38177)
+++ Zope3/trunk/src/zope/app/workflow/stateful/definition.py2005-08-30 
21:50:19 UTC (rev 38178)
@@ -46,6 +46,10 @@
 implements(IStatefulStatesContainer)
 
 
+class NoLocalProcessDefinition(Exception):

+No local process definition found
+
+

 class StateNamesVocabulary(SimpleVocabulary):
 Vocabulary providing the names of states in a local process definition.
 
@@ -61,7 +65,7 @@
 for obj in zapi.getParents(context):
 if IStatefulProcessDefinition.providedBy(obj):
 return obj.getStateNames()
-raise 'NoLocalProcessDefinition', 'No local process definition found.'
+raise NoLocalProcessDefinition('No local process definition found.')
 


I'm not sure it's worth worrying about (and I definitely prefer the new 
version better), but these type conversions are not backward compatible. 
   Of course it's only a problem if anyone is trying to catch the 
string version of the exception.

--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/ Massive style cleanup: Move to new raise exception style; for motivation, see:

2005-08-30 Thread Martijn Pieters

Benji York wrote:
I'm not sure it's worth worrying about (and I definitely prefer the new 
version better), but these type conversions are not backward compatible. 
   Of course it's only a problem if anyone is trying to catch the string 
version of the exception.


There were no references to these string exceptions anywhere in the 
Zope3 codebase, nor was the exception described in any interface. So I 
felt confident that any breakage I caused was self-inflicted by whomever 
was using this undocumented feature. ;)


Martijn Pieters


signature.asc
Description: OpenPGP digital signature
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com