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

Thomas Wouters thomas@xs4all.net
Thu, 1 Mar 2001 23:06:33 +0100


On Thu, Mar 01, 2001 at 11:31:27AM -0800, Ka-Ping Yee wrote:

> --- 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)]

Out of curiosity, why are you specialcasing 'module.so.1' ? Shouldn't that
be r'module\.so\.\d+' ? Or even better, r'module\.so(\.\d+)*' ?

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!