Cleanup issues identified by lgtm (#14459)
* cleanup issues identified by lgtm * fix the git_status check
This commit is contained in:
		
							parent
							
								
									5f38a98fa0
								
							
						
					
					
						commit
						fce9cb9338
					
				
					 17 changed files with 24 additions and 42 deletions
				
			
		| 
						 | 
				
			
			@ -197,7 +197,6 @@ def dumpBinary(data, canonical):
 | 
			
		|||
        print("")
 | 
			
		||||
 | 
			
		||||
    size = len(data)
 | 
			
		||||
    empty_rows = 0
 | 
			
		||||
    prev_row = ''
 | 
			
		||||
    first_repeat = True
 | 
			
		||||
    for pos in range(0, size, 16):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,7 +78,7 @@ def convert_from_uf2(buf):
 | 
			
		|||
        if datalen > 476:
 | 
			
		||||
            assert False, "Invalid UF2 data size at " + ptr
 | 
			
		||||
        newaddr = hd[3]
 | 
			
		||||
        if curraddr == None:
 | 
			
		||||
        if curraddr is None:
 | 
			
		||||
            appstartaddr = newaddr
 | 
			
		||||
            curraddr = newaddr
 | 
			
		||||
        padding = newaddr - curraddr
 | 
			
		||||
| 
						 | 
				
			
			@ -171,7 +171,7 @@ def convert_from_hex_to_uf2(buf):
 | 
			
		|||
            break
 | 
			
		||||
        elif tp == 0:
 | 
			
		||||
            addr = upper | (rec[1] << 8) | rec[2]
 | 
			
		||||
            if appstartaddr == None:
 | 
			
		||||
            if appstartaddr is None:
 | 
			
		||||
                appstartaddr = addr
 | 
			
		||||
            i = 4
 | 
			
		||||
            while i < len(rec) - 1:
 | 
			
		||||
| 
						 | 
				
			
			@ -215,7 +215,7 @@ def get_drives():
 | 
			
		|||
    def has_info(d):
 | 
			
		||||
        try:
 | 
			
		||||
            return os.path.isfile(d + INFO_FILE)
 | 
			
		||||
        except:
 | 
			
		||||
        except Exception:
 | 
			
		||||
            return False
 | 
			
		||||
 | 
			
		||||
    return list(filter(has_info, drives))
 | 
			
		||||
| 
						 | 
				
			
			@ -300,7 +300,7 @@ def main():
 | 
			
		|||
              (ext, len(outbuf), appstartaddr))
 | 
			
		||||
        if args.convert or ext != "uf2":
 | 
			
		||||
            drives = []
 | 
			
		||||
            if args.output == None:
 | 
			
		||||
            if args.output is None:
 | 
			
		||||
                args.output = "flash." + ext
 | 
			
		||||
        else:
 | 
			
		||||
            drives = get_drives()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue