[Python-checkins] python/dist/src/Lib modulefinder.py,1.7,1.8

theller at users.sourceforge.net theller at users.sourceforge.net
Fri Nov 14 05:28:44 EST 2003


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv17380

Modified Files:
	modulefinder.py 
Log Message:
SF #841977 - modulefinder fails to find extension modules in packages

The find_all_submodules() method in modulefinder only
looks for *.py, *.pyc, and *.pyo files.  Python
extension modules are only found if they are referenced
in import statements somewhere.

This patch uses the actual list from imp.get_suffixes().

Backported myself.


Index: modulefinder.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/modulefinder.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** modulefinder.py	18 Jul 2003 15:31:40 -0000	1.7
--- modulefinder.py	14 Nov 2003 10:28:42 -0000	1.8
***************
*** 211,215 ****
              return
          modules = {}
!         suffixes = [".py", ".pyc", ".pyo"]
          for dir in m.__path__:
              try:
--- 211,220 ----
              return
          modules = {}
!         # 'suffixes' used to be a list hardcoded to [".py", ".pyc", ".pyo"].
!         # But we must also collect Python extension modules - although
!         # we cannot separate normal dlls from Python extensions.
!         suffixes = []
!         for triple in imp.get_suffixes():
!             suffixes.append(triple[0])
          for dir in m.__path__:
              try:





More information about the Python-checkins mailing list