[Zope-CMF] Re: SVN: CMF/branches/1.6/ Avoid deprecation warnings with Zope 2.10.

Florent Guillaume fg at nuxeo.com
Fri Jun 9 14:36:56 EDT 2006


Tres Seaver wrote:
>> Modified: CMF/branches/1.6/CMFCore/FSFile.py
>> ===================================================================
>> --- CMF/branches/1.6/CMFCore/FSFile.py	2006-06-09 12:41:27 UTC (rev 68536)
>> +++ CMF/branches/1.6/CMFCore/FSFile.py	2006-06-09 13:40:32 UTC (rev 68537)
>> @@ -22,9 +22,14 @@
>>  from OFS.Cache import Cacheable
>>  from OFS.Image import File
>>  try:
>> -    from zope.app.content_types import guess_content_type
>> -except ImportError: # BBB: for Zope < 2.9
>> -    from OFS.content_types import guess_content_type
>> +    from zope.contenttype import guess_content_type
>> +except ImportError:
>> +    # BBB: for Zope < 2.10
>> +    try:
>> +        from zope.app.content_types import guess_content_type
>> +    except ImportError:
>> +        # BBB: for Zope < 2.9
>> +        from OFS.content_types import guess_content_type
>>  
> 
> 
> Florent:  1.6 is explicitly supposed to work with Zope 2.8.  Have you
> tested that this change doesn't break that (I don't think
> 'zope.contenttype.guessContentType' was importable in ZopeX3.0).

I've added just another level of try/except ImportError, I don't think it 
can break as the zope.contentype package didn't exist in Zope 2.8.

> 1.6 is a "stepping-stone" for projects which needed the new GenericSetup
> features, but couldn't move all the way to CMF 2.0;  making it less
> noisy under 2.10 has to give precedence to preserving BBB.

Sure, I keep that in mind.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-CMF mailing list