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
39f00377
Commit
39f00377
authored
Apr 03, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #802310: Generate always unique tkinter font names if not directly passed
parent
5af3e1af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Lib/tkinter/font.py
Lib/tkinter/font.py
+4
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/tkinter/font.py
View file @
39f00377
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
__version__
=
"0.9"
__version__
=
"0.9"
import
itertools
import
tkinter
import
tkinter
...
@@ -46,6 +47,8 @@ class Font:
...
@@ -46,6 +47,8 @@ class Font:
"""
"""
counter
=
itertools
.
count
(
1
)
def
_set
(
self
,
kw
):
def
_set
(
self
,
kw
):
options
=
[]
options
=
[]
for
k
,
v
in
kw
.
items
():
for
k
,
v
in
kw
.
items
():
...
@@ -75,7 +78,7 @@ class Font:
...
@@ -75,7 +78,7 @@ class Font:
else
:
else
:
font
=
self
.
_set
(
options
)
font
=
self
.
_set
(
options
)
if
not
name
:
if
not
name
:
name
=
"font"
+
str
(
id
(
self
))
name
=
"font"
+
str
(
next
(
self
.
counter
))
self
.
name
=
name
self
.
name
=
name
if
exists
:
if
exists
:
...
...
Misc/NEWS
View file @
39f00377
...
@@ -19,6 +19,8 @@ Core and Builtins
...
@@ -19,6 +19,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #802310: Generate always unique tkinter font names if not directly passed.
- Issue #14151: Raise a ValueError, not a NameError, when trying to create
- Issue #14151: Raise a ValueError, not a NameError, when trying to create
a multiprocessing Client or Listener with an AF_PIPE type address under
a multiprocessing Client or Listener with an AF_PIPE type address under
non-Windows platforms. Patch by Popa Claudiu.
non-Windows platforms. Patch by Popa Claudiu.
...
...
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