mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	[3.13] gh-128562: Fix generation of the tkinter widget names (GH-128604) (GH-128791)
There were possible conflicts if the widget class name ends with a digit.
(cherry picked from commit da8825ea95)
Co-authored-by: Zhikang Yan <2951256653@qq.com>
			
			
This commit is contained in:
		
							parent
							
								
									66d0636025
								
							
						
					
					
						commit
						b1065767b4
					
				
					 3 changed files with 12 additions and 1 deletions
				
			
		|  | @ -31,12 +31,20 @@ def test_repr(self): | |||
|         self.assertEqual(repr(f), '<tkinter.Frame object .top.child>') | ||||
| 
 | ||||
|     def test_generated_names(self): | ||||
|         class Button2(tkinter.Button): | ||||
|             pass | ||||
| 
 | ||||
|         t = tkinter.Toplevel(self.root) | ||||
|         f = tkinter.Frame(t) | ||||
|         f2 = tkinter.Frame(t) | ||||
|         self.assertNotEqual(str(f), str(f2)) | ||||
|         b = tkinter.Button(f2) | ||||
|         for name in str(b).split('.'): | ||||
|         b2 = Button2(f2) | ||||
|         for name in str(b).split('.') + str(b2).split('.'): | ||||
|             self.assertFalse(name.isidentifier(), msg=repr(name)) | ||||
|         b3 = tkinter.Button(f2) | ||||
|         b4 = Button2(f2) | ||||
|         self.assertEqual(len({str(b), str(b2), str(b3), str(b4)}), 4) | ||||
| 
 | ||||
|     @requires_tk(8, 6, 6) | ||||
|     def test_tk_busy(self): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)