mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 16:01:20 +00:00 
			
		
		
		
	target: Fix AndroidTarget pickling
Avoid pickling the "clear_logcat_lock". Instead, discard the attribute and re-initialize it anew.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							f5cfcafb08
						
					
				
				
					commit
					42e62aed57
				
			@@ -1572,8 +1572,23 @@ class AndroidTarget(Target):
 | 
			
		||||
                                            conn_cls=conn_cls,
 | 
			
		||||
                                            is_container=is_container)
 | 
			
		||||
        self.package_data_directory = package_data_directory
 | 
			
		||||
        self._init_logcat_lock()
 | 
			
		||||
 | 
			
		||||
    def _init_logcat_lock(self):
 | 
			
		||||
        self.clear_logcat_lock = threading.Lock()
 | 
			
		||||
 | 
			
		||||
    def __getstate__(self):
 | 
			
		||||
        dct = super().__getstate__()
 | 
			
		||||
        return {
 | 
			
		||||
            k: v
 | 
			
		||||
            for k, v in dct.items()
 | 
			
		||||
            if k not in ('clear_logcat_lock',)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    def __setstate__(self, dct):
 | 
			
		||||
        self.__dict__.update(dct)
 | 
			
		||||
        self._init_logcat_lock()
 | 
			
		||||
 | 
			
		||||
    def reset(self, fastboot=False):  # pylint: disable=arguments-differ
 | 
			
		||||
        try:
 | 
			
		||||
            self.execute('reboot {}'.format(fastboot and 'fastboot' or ''),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user