-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff Kunce wrote:
> Hi -
> 
> If this is the wrong place for this question, or if it is a FAQ, please
> send me pointers to better locations!
> 
> I have a large code base that I am migrating form python 2.4 to 2.6
> (because of going from zope 2.9 to 2.12)  I would like to make the code
> compatible with *both* where possible, so I don't need to maintain two
> versions.
> 
> The old code has a lot of old-style usage for exeptions, like
>     raise 'MyFirstException'
> and
>     except MySecondException, var:
> 
> Does anyone have suggestions/guidelines for exception handling idioms
> that are compatible with python 2.4 and 2.6 (and beyond?)

old:

MyException = 'myStupidStringException'

new:

class MyException(Exception):
   pass

The Python documentation tells you more on exception handling.

- -aj



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJMpsJPAAoJEADcfz7u4AZjgqYLwNR54KcAlOwWWVrHz4EC92yr
yK0+/aCsV/MiPxGY7s3a3rs0eCjZcbNHuVyacSYuxUiez/EhCK1O9WcW9xWAsJvT
UB3K5G6fmMXcudguMd4LksEnHtlwPNSSSuw+qMjU7Xb4B+FdnsS5bnTQUPmbZQLs
sZ9LfPQClgAKc8dHUlbNeoIeULKX/1NJNFC/CebOtoEqv6NbM8xIHdVER2bFTI57
rrg0jiVgkufPbCdM5iLqQpVwNeY+268wJ++BCLDiPB7Pkv6Ax67tLN11nhC+zH4S
26HwNhbNTA68nCV51628O84t49znhRMfs1BUZcosip+G81TxzdnDckK3q6hM3uwJ
r7KIqR1PX1xXZlkkTtYViY4eTbNKA7tJmsBbjeebC5VromJ0/gVggJE/nU2E6gvA
LZIkALEJ/TN0F4dgQUR+hizoPTbcfviCgWqLIreLBfmxW33DG7poCtbJyYPYhgnq
SJaXaaf0aH2KhVQ+r6SORa2s+s3vxEM=
=abJz
-----END PGP SIGNATURE-----

<<attachment: lists.vcf>>

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to