mirror of
				https://github.com/kholia/OSX-KVM.git
				synced 2025-11-03 21:22:44 +00:00 
			
		
		
		
	Handle situations where terminalsize cannot be found
This commit is contained in:
		
							parent
							
								
									ad213b6c80
								
							
						
					
					
						commit
						76bea74a08
					
				@ -234,7 +234,10 @@ def save_image(url, sess, filename='', directory=''):
 | 
			
		||||
                break
 | 
			
		||||
            fh.write(chunk)
 | 
			
		||||
            size += len(chunk)
 | 
			
		||||
            terminalsize = max(os.get_terminal_size().columns - TERMINAL_MARGIN, 0)
 | 
			
		||||
            try:
 | 
			
		||||
                terminalsize = max(os.get_terminal_size().columns - TERMINAL_MARGIN, 0)
 | 
			
		||||
            except OSError:
 | 
			
		||||
                terminalsize = 80
 | 
			
		||||
            if oldterminalsize != terminalsize:
 | 
			
		||||
                print(f'\r{"":<{terminalsize}}', end='')
 | 
			
		||||
                oldterminalsize = terminalsize
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user