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
f4558e8b
Commit
f4558e8b
authored
Feb 19, 2014
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
57d240ef
056eb027
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
Lib/pydoc.py
Lib/pydoc.py
+6
-3
Lib/test/test_pydoc.py
Lib/test/test_pydoc.py
+10
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/pydoc.py
View file @
f4558e8b
...
...
@@ -1244,9 +1244,12 @@ location listed above.
doc
=
getdoc
(
value
)
else
:
doc
=
None
push
(
self
.
docother
(
getattr
(
object
,
name
,
None
)
or
homecls
.
__dict__
[
name
],
name
,
mod
,
maxlen
=
70
,
doc
=
doc
)
+
'
\
n
'
)
try
:
obj
=
getattr
(
object
,
name
)
except
AttributeError
:
obj
=
homecls
.
__dict__
[
name
]
push
(
self
.
docother
(
obj
,
name
,
mod
,
maxlen
=
70
,
doc
=
doc
)
+
'
\
n
'
)
return
attrs
attrs
=
[(
name
,
kind
,
cls
,
value
)
...
...
Lib/test/test_pydoc.py
View file @
f4558e8b
...
...
@@ -386,6 +386,16 @@ class PydocDocTest(unittest.TestCase):
print_diffs
(
expected_text
,
result
)
self
.
fail
(
"outputs are not equal, see diff above"
)
def
test_text_enum_member_with_value_zero
(
self
):
# Test issue #20654 to ensure enum member with value 0 can be
# displayed. It used to throw KeyError: 'zero'.
import
enum
class
BinaryInteger
(
enum
.
IntEnum
):
zero
=
0
one
=
1
doc
=
pydoc
.
render_doc
(
BinaryInteger
)
self
.
assertIn
(
'<BinaryInteger.zero: 0>'
,
doc
)
def
test_issue8225
(
self
):
# Test issue8225 to ensure no doc link appears for xml.etree
result
,
doc_loc
=
get_pydoc_text
(
xml
.
etree
)
...
...
Misc/NEWS
View file @
f4558e8b
...
...
@@ -28,6 +28,8 @@ Core and Builtins
Library
-------
-
Issue
#
20654
:
Fixed
pydoc
for
enums
with
zero
value
.
Patch
by
Vajrasky
Kok
.
-
Issue
#
20635
:
Fixed
grid_columnconfigure
()
and
grid_rowconfigure
()
methods
of
Tkinter
widgets
to
work
in
wantobjects
=
True
mode
.
...
...
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