mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	utils/version: do not decode bytes
Check that the resulting output inside get_commit() is a str before attempting to decode it when running on Python 3.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							56f3b1c317
						
					
				
				
					commit
					8ac89fe9ed
				
			@@ -24,7 +24,7 @@ def get_commit():
 | 
			
		||||
    p.wait()
 | 
			
		||||
    if p.returncode:
 | 
			
		||||
        return None
 | 
			
		||||
    if sys.version_info[0] == 3:
 | 
			
		||||
    if sys.version_info[0] == 3 and isinstance(std, str):
 | 
			
		||||
        return std[:8].decode(sys.stdout.encoding, 'replace')
 | 
			
		||||
    else:
 | 
			
		||||
        return std[:8]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user