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
580019f1
Commit
580019f1
authored
Oct 06, 2011
by
Ned Deily
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7425: Prevent pydoc -k failures due to module import errors.
(Backport to 2.7 of existing 3.x fix)
parent
6aeac69f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Lib/pydoc.py
Lib/pydoc.py
+6
-5
No files found.
Lib/pydoc.py
View file @
580019f1
...
...
@@ -52,7 +52,7 @@ Richard Chamberlain, for the first implementation of textdoc.
# the current directory is changed with os.chdir(), an incorrect
# path will be displayed.
import
sys
,
imp
,
os
,
re
,
types
,
inspect
,
__builtin__
,
pkgutil
import
sys
,
imp
,
os
,
re
,
types
,
inspect
,
__builtin__
,
pkgutil
,
warnings
from
repr
import
Repr
from
string
import
expandtabs
,
find
,
join
,
lower
,
split
,
strip
,
rfind
,
rstrip
from
traceback
import
extract_tb
...
...
@@ -1968,10 +1968,11 @@ def apropos(key):
if
modname
[
-
9
:]
==
'.__init__'
:
modname
=
modname
[:
-
9
]
+
' (package)'
print
modname
,
desc
and
'- '
+
desc
try
:
import
warnings
except
ImportError
:
pass
else
:
warnings
.
filterwarnings
(
'ignore'
)
# ignore problems during import
ModuleScanner
().
run
(
callback
,
key
)
def
onerror
(
modname
):
pass
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
'ignore'
)
# ignore problems during import
ModuleScanner
().
run
(
callback
,
key
,
onerror
=
onerror
)
# --------------------------------------------------- web browser interface
...
...
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