mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly)
This commit is contained in:
		
							parent
							
								
									bbb7efd72b
								
							
						
					
					
						commit
						55bdb8e4ac
					
				
					 1 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
					@ -1,8 +1,14 @@
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
from _tkinter import TclError
 | 
					import Tkinter
 | 
				
			||||||
from test import test_support
 | 
					from test import test_support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					try:
 | 
				
			||||||
 | 
					    Tkinter.Button()
 | 
				
			||||||
 | 
					except Tkinter.TclError, msg:
 | 
				
			||||||
 | 
					    # assuming tk is not available
 | 
				
			||||||
 | 
					    raise test_support.TestSkipped("tk not available: %s" % msg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
this_dir = os.path.dirname(os.path.abspath(__file__))
 | 
					this_dir = os.path.dirname(os.path.abspath(__file__))
 | 
				
			||||||
lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
 | 
					lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
 | 
				
			||||||
    'lib-tk', 'test'))
 | 
					    'lib-tk', 'test'))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue