add search 'TypeError' error handling
This commit is contained in:
		
							parent
							
								
									0e00c42827
								
							
						
					
					
						commit
						a69bf7e6a0
					
				| 
						 | 
				
			
			@ -76,6 +76,7 @@ class Proc:
 | 
			
		|||
        :return: list of dictionaries with descriptions of found processes
 | 
			
		||||
        """
 | 
			
		||||
        proc_found = []
 | 
			
		||||
        try:
 | 
			
		||||
            for proc in cls.list():
 | 
			
		||||
                if exclude and (exclude in proc['execpid'] or exclude in proc['exename'] or
 | 
			
		||||
                                exclude in proc['exepath'] or exclude in proc['cmdline']):
 | 
			
		||||
| 
						 | 
				
			
			@ -83,6 +84,9 @@ class Proc:
 | 
			
		|||
                elif find in proc['execpid'] or find in proc['exename'] or \
 | 
			
		||||
                        find in proc['exepath'] or find in proc['cmdline']:
 | 
			
		||||
                    proc_found.append(proc)
 | 
			
		||||
        except TypeError as ex:
 | 
			
		||||
            print('ON', platform, 'PLATFORM', 'search ERROR:', ex)
 | 
			
		||||
        finally:
 | 
			
		||||
            if len(proc_found) == 0:
 | 
			
		||||
                return None
 | 
			
		||||
            else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user