1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Clean up minor warnings from LGTM.com (#7500)

* Clean up minor warnings from LGTM.com

LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.

Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list

No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.

* Back out HTML changes and rerun boards.txt.py
This commit is contained in:
Earle F. Philhower, III
2020-08-03 19:19:04 -07:00
committed by GitHub
parent a8e35a579c
commit 9afb084159
9 changed files with 36 additions and 43 deletions

View File

@ -57,7 +57,7 @@ def get_segment_size_addr(elf, segment, path):
def read_segment(elf, segment, path):
fd, tmpfile = tempfile.mkstemp()
os.close(fd)
p = subprocess.check_call([path + "/xtensa-lx106-elf-objcopy", '-O', 'binary', '--only-section=' + segment, elf, tmpfile], stdout=subprocess.PIPE)
subprocess.check_call([path + "/xtensa-lx106-elf-objcopy", '-O', 'binary', '--only-section=' + segment, elf, tmpfile], stdout=subprocess.PIPE)
with open(tmpfile, "rb") as f:
raw = f.read()
os.remove(tmpfile)
@ -85,7 +85,7 @@ def write_bin(out, args, elf, segments, to_addr):
try:
for data in raw:
checksum = checksum ^ ord(data)
except:
except Exception:
for data in raw:
checksum = checksum ^ data
total_size += 1