mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-11-03 21:02:36 +00:00 
			
		
		
		
	Rework get_next_output
Use try/except to catch nonetype case. For whatever reason, databuffer could still be None, this should take care of that.
This commit is contained in:
		@@ -142,12 +142,13 @@ class ConsoleSession(object):
 | 
			
		||||
        self.reaper.cancel()
 | 
			
		||||
        currtime = util.monotonic_time()
 | 
			
		||||
        deadline = currtime + 45
 | 
			
		||||
        if self.databuffer is None:
 | 
			
		||||
        try:
 | 
			
		||||
            while len(self.databuffer) == 0 and currtime < deadline:
 | 
			
		||||
                timeo = deadline - currtime
 | 
			
		||||
                self.conshdl._console.wait_for_data(timeout=timeo)
 | 
			
		||||
                currtime = util.monotonic_time()
 | 
			
		||||
        except TypeError:
 | 
			
		||||
            return ""
 | 
			
		||||
        while len(self.databuffer) == 0 and currtime < deadline:
 | 
			
		||||
            timeo = deadline - currtime
 | 
			
		||||
            self.conshdl._console.wait_for_data(timeout=timeo)
 | 
			
		||||
            currtime = util.monotonic_time()
 | 
			
		||||
        retval = self.databuffer
 | 
			
		||||
        self.databuffer = ""
 | 
			
		||||
        self.reaper = eventlet.spawn_after(15, self.destroy)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user