[Zope-CMF] Re: [dev] failing tests and other unit test issues
Tres Seaver
tseaver at zope.com
Mon Apr 4 11:19:05 EDT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
yuppie wrote:
> Lennart Regebro wrote:
>
>>> 3.) Zope 2.8 warnings
>>>
>>> 'Zope2' is not available in Zope 2.7 and 'Zope' is deprecated in Zope
>>> 2.8. Same with 'transaction' and 'get_transaction'.
>>>
>>> Has anybody a better idea to resolve it than this way:
>>
>>
>>
>> Well, the deprecation procedures and warning is there to tell you that
>> you are using a way that works no, but will stop working later. The
>> standard pattern when you need to support both the version where they
>> are deprecated, and the version where they are not, is to do
>> nothing... And then when you no longer need to support the older
>> version, you move up to the new non-deprecated API.
>
>
> These deprecation warnings produce *a lot of* noise. All I want is to
> reduce that noise.
How about
try:
import Zope2
except ImportError:
Import Zope as Zope2
and then s/\<Zope\>/Zope2/g?
Tres.
- --
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCUVrpGqWXf00rNCgRAihHAJ9w/e7D4lfp/rWoiltTpoGJKSTmCgCeNGlm
rgBlquBucZZMvL8gJBWIzsA=
=G2b+
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list