[Zope3-checkins] CVS: Zope3/utilities - finddeps.py:1.3

Fred L. Drake, Jr. fred at zope.com
Thu Mar 11 11:50:22 EST 2004


Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv15254

Modified Files:
	finddeps.py 
Log Message:
be more careful in checking whether a module is a package


=== Zope3/utilities/finddeps.py 1.2 => 1.3 ===
--- Zope3/utilities/finddeps.py:1.2	Wed Feb 25 16:16:33 2004
+++ Zope3/utilities/finddeps.py	Thu Mar 11 11:50:21 2004
@@ -234,7 +234,7 @@
             if pythonfile.match(file):
                 deps += getDependenciesOfPythonFile(filePath)
             elif zcml and zcmlfile.match(file):
-                deps += getDependenciesOfZCMLFile(filePath)                
+                deps += getDependenciesOfZCMLFile(filePath)
             elif os.path.isdir(filePath) and \
                      '__init__.py' in os.listdir(filePath):
                 deps += getDependencies(filePath)
@@ -272,8 +272,9 @@
             deps.append(dep)
             paths.append(dep.path)
             modulePath = __import__(dep.path).__file__
-            if modulePath.endswith('__init__.pyc'):
-                modulePath = modulePath[:-12]
+            dirname, basename = os.path.split(modulePath)
+            if basename in ('__init__.py', '__init__.pyc', '__init__.pyo'):
+                modulePath = os.path.join(dirname, '')
             getAllCleanedDependencies(modulePath, zcml, deps, paths)
     deps = filterMostGeneral(deps)
     deps.sort()




More information about the Zope3-Checkins mailing list