[Zope-Checkins] CVS: Zope/lib/python/App - Extensions.py:1.22

Fred L. Drake, Jr. fred@zope.com
Wed, 9 Jul 2003 14:44:31 -0400


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv2179

Modified Files:
	Extensions.py 
Log Message:
- delay import of the rotor module; this avoids deprecation warnings
  when it isn't actually used (like in the unit tests...)
- add a comment about a confusing bit of code


=== Zope/lib/python/App/Extensions.py 1.21 => 1.22 ===
--- Zope/lib/python/App/Extensions.py:1.21	Tue Feb 11 12:17:04 2003
+++ Zope/lib/python/App/Extensions.py	Wed Jul  9 14:44:24 2003
@@ -17,7 +17,7 @@
 $Id$'''
 __version__='$Revision$'[11:-2]
 
-import os, zlib, rotor, imp
+import os, zlib, imp
 import Products
 path_split=os.path.split
 path_join=os.path.join
@@ -110,6 +110,7 @@
 
     base, ext = os.path.splitext(module)
     if ext in ('py', 'pyp', 'pyc'):
+        # XXX should never happen; splitext() keeps '.' with the extension
         p = base
     else:
         p = module
@@ -128,6 +129,7 @@
         m=binmod.__dict__
 
     elif ext=='.pyp':
+        import rotor
         prod_id=module.split('.', 1)[0]
         data=zlib.decompress(
             rotor.newrotor(prod_id +' shshsh').decrypt(open(p,'rb').read())