all: Fix cases of Python variable assigned but never used.
This fixes ruff rule F841.
This commit is contained in:
parent
79e57473b2
commit
2a1db770ce
|
@ -28,7 +28,6 @@ def main():
|
||||||
while True:
|
while True:
|
||||||
res = s.accept()
|
res = s.accept()
|
||||||
client_s = res[0]
|
client_s = res[0]
|
||||||
client_addr = res[1]
|
|
||||||
req = client_s.recv(4096)
|
req = client_s.recv(4096)
|
||||||
print("Request:")
|
print("Request:")
|
||||||
print(req)
|
print(req)
|
||||||
|
|
|
@ -109,7 +109,7 @@ def reset_board(args):
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
tn.close()
|
tn.close()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return success
|
return success
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ def verify_update(args):
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
tn.close()
|
tn.close()
|
||||||
except Exception as e:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return success
|
return success
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,6 @@ class Pins(object):
|
||||||
# Extract indexes from header row
|
# Extract indexes from header row
|
||||||
pad_col = header.index("Pad")
|
pad_col = header.index("Pad")
|
||||||
adc_col = header.index("ADC")
|
adc_col = header.index("ADC")
|
||||||
acmp_col = header.index("ACMP")
|
|
||||||
#
|
#
|
||||||
for idx, row in enumerate(rows):
|
for idx, row in enumerate(rows):
|
||||||
pad = row[pad_col]
|
pad = row[pad_col]
|
||||||
|
|
|
@ -216,8 +216,6 @@ class ILI9341:
|
||||||
|
|
||||||
self.write_cmd(0x2C)
|
self.write_cmd(0x2C)
|
||||||
|
|
||||||
num_of_pixels = self.height * self.width
|
|
||||||
|
|
||||||
for row in range(0, self.pages):
|
for row in range(0, self.pages):
|
||||||
for pixel_pos in range(0, 8):
|
for pixel_pos in range(0, 8):
|
||||||
for col in range(0, self.width):
|
for col in range(0, self.width):
|
||||||
|
|
|
@ -207,7 +207,7 @@ class Pins(object):
|
||||||
for row in rows:
|
for row in rows:
|
||||||
try:
|
try:
|
||||||
pin_num = parse_pin(row[pinname_col])
|
pin_num = parse_pin(row[pinname_col])
|
||||||
except Exception as e:
|
except Exception:
|
||||||
# import traceback; traceback.print_exc()
|
# import traceback; traceback.print_exc()
|
||||||
continue
|
continue
|
||||||
pin = Pin(pin_num)
|
pin = Pin(pin_num)
|
||||||
|
@ -228,7 +228,7 @@ class Pins(object):
|
||||||
|
|
||||||
cpu_pin_name = row[1]
|
cpu_pin_name = row[1]
|
||||||
try:
|
try:
|
||||||
pin_num = parse_pin(cpu_pin_name)
|
parse_pin(cpu_pin_name)
|
||||||
except:
|
except:
|
||||||
# import traceback; traceback.print_exc()
|
# import traceback; traceback.print_exc()
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -265,7 +265,6 @@ def main():
|
||||||
reg_defs["GPIO"].append(["BSRRL", 0x18, 16, "legacy register"])
|
reg_defs["GPIO"].append(["BSRRL", 0x18, 16, "legacy register"])
|
||||||
reg_defs["GPIO"].append(["BSRRH", 0x1A, 16, "legacy register"])
|
reg_defs["GPIO"].append(["BSRRH", 0x1A, 16, "legacy register"])
|
||||||
|
|
||||||
modules = []
|
|
||||||
needed_qstrs = set()
|
needed_qstrs = set()
|
||||||
needed_mpzs = set()
|
needed_mpzs = set()
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Bootloader:
|
||||||
self.i2c.readfrom_into(self.addr, self.buf1)
|
self.i2c.readfrom_into(self.addr, self.buf1)
|
||||||
n = self.buf1[0]
|
n = self.buf1[0]
|
||||||
break
|
break
|
||||||
except OSError as er:
|
except OSError:
|
||||||
time.sleep_us(500)
|
time.sleep_us(500)
|
||||||
if time.ticks_diff(time.ticks_ms(), start) > 5000:
|
if time.ticks_diff(time.ticks_ms(), start) > 5000:
|
||||||
raise Exception("timeout")
|
raise Exception("timeout")
|
||||||
|
|
|
@ -172,5 +172,5 @@ else:
|
||||||
try:
|
try:
|
||||||
set_conout_mode(mode, mask)
|
set_conout_mode(mode, mask)
|
||||||
VT_ENABLED = True
|
VT_ENABLED = True
|
||||||
except WindowsError as e:
|
except WindowsError:
|
||||||
VT_ENABLED = False
|
VT_ENABLED = False
|
||||||
|
|
|
@ -449,7 +449,7 @@ class PyboardCommand:
|
||||||
try:
|
try:
|
||||||
stat = os.lstat(self.data_ilistdir[0] + "/" + entry)
|
stat = os.lstat(self.data_ilistdir[0] + "/" + entry)
|
||||||
mode = stat.st_mode & 0xC000
|
mode = stat.st_mode & 0xC000
|
||||||
except OSError as er:
|
except OSError:
|
||||||
mode = 0
|
mode = 0
|
||||||
self.wr_str(entry)
|
self.wr_str(entry)
|
||||||
self.wr_u32(mode)
|
self.wr_u32(mode)
|
||||||
|
|
|
@ -1120,7 +1120,6 @@ class RawCodeNative(RawCode):
|
||||||
|
|
||||||
i_top = len(self.fun_data)
|
i_top = len(self.fun_data)
|
||||||
i = 0
|
i = 0
|
||||||
qi = 0
|
|
||||||
while i < i_top:
|
while i < i_top:
|
||||||
# copy machine code (max 16 bytes)
|
# copy machine code (max 16 bytes)
|
||||||
i16 = min(i + 16, i_top)
|
i16 = min(i + 16, i_top)
|
||||||
|
@ -1276,7 +1275,7 @@ def read_raw_code(reader, parent_name, qstr_table, obj_table, segments):
|
||||||
if native_scope_flags & MP_SCOPE_FLAG_VIPERRODATA:
|
if native_scope_flags & MP_SCOPE_FLAG_VIPERRODATA:
|
||||||
rodata_size = reader.read_uint()
|
rodata_size = reader.read_uint()
|
||||||
if native_scope_flags & MP_SCOPE_FLAG_VIPERBSS:
|
if native_scope_flags & MP_SCOPE_FLAG_VIPERBSS:
|
||||||
bss_size = reader.read_uint()
|
reader.read_uint() # bss_size
|
||||||
if native_scope_flags & MP_SCOPE_FLAG_VIPERRODATA:
|
if native_scope_flags & MP_SCOPE_FLAG_VIPERRODATA:
|
||||||
reader.read_bytes(rodata_size)
|
reader.read_bytes(rodata_size)
|
||||||
if native_scope_flags & MP_SCOPE_FLAG_VIPERRELOC:
|
if native_scope_flags & MP_SCOPE_FLAG_VIPERRELOC:
|
||||||
|
@ -1285,10 +1284,10 @@ def read_raw_code(reader, parent_name, qstr_table, obj_table, segments):
|
||||||
if op == 0xFF:
|
if op == 0xFF:
|
||||||
break
|
break
|
||||||
if op & 1:
|
if op & 1:
|
||||||
addr = reader.read_uint()
|
reader.read_uint() # addr
|
||||||
op >>= 1
|
op >>= 1
|
||||||
if op <= 5 and op & 1:
|
if op <= 5 and op & 1:
|
||||||
n = reader.read_uint()
|
reader.read_uint() # n
|
||||||
else:
|
else:
|
||||||
assert kind == MP_CODE_NATIVE_ASM
|
assert kind == MP_CODE_NATIVE_ASM
|
||||||
native_n_pos_args = reader.read_uint()
|
native_n_pos_args = reader.read_uint()
|
||||||
|
|
|
@ -471,7 +471,6 @@ def do_relocation_text(env, text_addr, r):
|
||||||
# Extract relevant info about symbol that's being relocated
|
# Extract relevant info about symbol that's being relocated
|
||||||
s = r.sym
|
s = r.sym
|
||||||
s_bind = s.entry["st_info"]["bind"]
|
s_bind = s.entry["st_info"]["bind"]
|
||||||
s_shndx = s.entry["st_shndx"]
|
|
||||||
s_type = s.entry["st_info"]["type"]
|
s_type = s.entry["st_info"]["type"]
|
||||||
r_offset = r["r_offset"] + text_addr
|
r_offset = r["r_offset"] + text_addr
|
||||||
r_info_type = r["r_info_type"]
|
r_info_type = r["r_info_type"]
|
||||||
|
|
Loading…
Reference in New Issue