[Python-checkins] CVS: python/dist/src/Lib pydoc.py,1.9,1.10

Ka-Ping Yee ping@users.sourceforge.net
Thu, 01 Mar 2001 11:31:27 -0800


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

Modified Files:
	pydoc.py 
Log Message:
Also accept .so as an extension for module files.


Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** pydoc.py	2001/03/01 13:55:20	1.9
--- pydoc.py	2001/03/01 19:31:25	1.10
***************
*** 128,139 ****
      """Return the Python module name for a given path, or None."""
      filename = os.path.basename(path)
!     if lower(filename[-3:]) == '.py':
!         return filename[:-3]
!     elif lower(filename[-4:]) in ['.pyc', '.pyd', '.pyo']:
!         return filename[:-4]
!     elif lower(filename[-11:]) == 'module.so':
!         return filename[:-11]
!     elif lower(filename[-13:]) == 'module.so.1':
!         return filename[:-13]
  
  class DocImportError(Exception):
--- 128,135 ----
      """Return the Python module name for a given path, or None."""
      filename = os.path.basename(path)
!     for ending in ['.py', '.pyc', '.pyd', '.pyo',
!                    'module.so', 'module.so.1', '.so']:
!         if len(filename) > len(ending) and filename[-len(ending):] == ending:
!             return filename[:-len(ending)]
  
  class DocImportError(Exception):