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
d61d077b
Commit
d61d077b
authored
Sep 17, 2010
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1730136: Fix comparison between a tk Font object and an object of a different type.
parent
19ec67ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
Lib/tkinter/font.py
Lib/tkinter/font.py
+1
-1
Lib/tkinter/test/test_tkinter/test_font.py
Lib/tkinter/test/test_tkinter/test_font.py
+20
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/tkinter/font.py
View file @
d61d077b
...
...
@@ -97,7 +97,7 @@ class Font:
return
self
.
name
def
__eq__
(
self
,
other
):
return
self
.
name
==
other
.
name
and
isinstance
(
other
,
Font
)
return
isinstance
(
other
,
Font
)
and
self
.
name
==
other
.
name
def
__getitem__
(
self
,
key
):
return
self
.
cget
(
key
)
...
...
Lib/tkinter/test/test_tkinter/test_font.py
0 → 100644
View file @
d61d077b
import
unittest
import
tkinter
from
tkinter
import
font
from
test.support
import
requires
,
run_unittest
requires
(
'gui'
)
class
FontTest
(
unittest
.
TestCase
):
def
test_font_eq
(
self
):
font1
=
font
.
nametofont
(
"system"
)
font2
=
font
.
nametofont
(
"system"
)
self
.
assertIsNot
(
font1
,
font2
)
self
.
assertEqual
(
font1
,
font2
)
self
.
assertNotEqual
(
font1
,
font1
.
copy
())
self
.
assertNotEqual
(
font1
,
0
)
tests_gui
=
(
FontTest
,
)
if
__name__
==
"__main__"
:
run_unittest
(
*
tests_gui
)
Misc/NEWS
View file @
d61d077b
...
...
@@ -52,6 +52,9 @@ Core and Builtins
Library
-------
- Issue #1730136: Fix the comparison between a tk.font.Font and an object of
another kind.
- Issue #9441: logging has better coverage for rotating file handlers.
- Issue #9865: collections.OrderedDict now has a __sizeof__ method.
...
...
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