mirror of
				https://github.com/Rudd-O/ansible-qubes.git
				synced 2025-11-04 05:28:54 +01:00 
			
		
		
		
	Support older Python 3 versions that do not have os.setblocking
This commit is contained in:
		
							parent
							
								
									c38ed365ed
								
							
						
					
					
						commit
						e73c37d96e
					
				@ -172,7 +172,10 @@ class Signaler(MyThread):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def unblock(fobj):
 | 
			
		||||
  os.set_blocking(fobj.fileno(), False)
 | 
			
		||||
  if hasattr(os, "set_blocking"):
 | 
			
		||||
    return os.set_blocking(fobj.fileno(), False)
 | 
			
		||||
  fl = fcntl.fcntl(fobj, fcntl.F_GETFL)
 | 
			
		||||
  fcntl.fcntl(fobj, fcntl.F_SETFL, fl | os.O_NONBLOCK)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def write(dst, buffer, l):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user