Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
66f82370
Commit
66f82370
authored
Mar 01, 2001
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also accept .so as an extension for module files.
parent
fbc8f7e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
Lib/pydoc.py
Lib/pydoc.py
+4
-8
No files found.
Lib/pydoc.py
View file @
66f82370
...
...
@@ -127,14 +127,10 @@ def stripid(text):
def
modulename
(
path
):
"""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
]
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
):
"""Class for errors while trying to import something to document it."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment