The following issues were found
tests/extmod/framebuf1.py
6 issues
Line: 5
Column: 5
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
Reported by Pylint.
Line: 1
Column: 1
try:
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
w = 5
h = 16
size = w * h // 8
Reported by Pylint.
Line: 7
Column: 1
print("SKIP")
raise SystemExit
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",
Reported by Pylint.
Line: 8
Column: 1
raise SystemExit
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",
framebuf.MONO_HLSB: "MONO_HLSB",
Reported by Pylint.
Line: 9
Column: 1
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
framebuf.MONO_VLSB: "MONO_VLSB",
framebuf.MONO_HLSB: "MONO_HLSB",
framebuf.MONO_HMSB: "MONO_HMSB",
Reported by Pylint.
Line: 17
Column: 16
framebuf.MONO_HMSB: "MONO_HMSB",
}
for mapping in maps.keys():
for x in range(size):
buf[x] = 0
fbuf = framebuf.FrameBuffer(buf, w, h, mapping)
print(maps[mapping])
# access as buffer
Reported by Pylint.
tests/net_hosted/connect_nonblock.py
6 issues
Line: 6
Column: 1
try:
import usocket as socket
import uerrno as errno
except:
import socket, errno
def test(peer_addr):
s = socket.socket()
Reported by Pylint.
Line: 1
Column: 1
# test that socket.connect() on a non-blocking socket raises EINPROGRESS
try:
import usocket as socket
import uerrno as errno
except:
import socket, errno
Reported by Pylint.
Line: 7
Column: 5
import usocket as socket
import uerrno as errno
except:
import socket, errno
def test(peer_addr):
s = socket.socket()
s.setblocking(False)
Reported by Pylint.
Line: 10
Column: 1
import socket, errno
def test(peer_addr):
s = socket.socket()
s.setblocking(False)
try:
s.connect(peer_addr)
except OSError as er:
Reported by Pylint.
Line: 11
Column: 5
def test(peer_addr):
s = socket.socket()
s.setblocking(False)
try:
s.connect(peer_addr)
except OSError as er:
print(er.errno == errno.EINPROGRESS)
Reported by Pylint.
Line: 15
Column: 5
s.setblocking(False)
try:
s.connect(peer_addr)
except OSError as er:
print(er.errno == errno.EINPROGRESS)
s.close()
if __name__ == "__main__":
Reported by Pylint.
ports/esp32/boards/manifest_release.py
6 issues
Line: 1
Column: 1
include("manifest.py")
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
Line: 3
Column: 1
include("manifest.py")
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
Line: 5
Column: 1
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
Line: 6
Column: 1
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
Line: 7
Column: 1
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
Line: 1
Column: 1
include("manifest.py")
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")
Reported by Pylint.
py/makemoduledefs.py
6 issues
Line: 44
Column: 5
:param str c_file: path to c file to check
:return: List[(module_name, obj_module, enabled_define)]
"""
global pattern
if c_file is None:
# No c file to match the object file, skip
return set()
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# This pre-processor parses provided objects' c files for
# MP_REGISTER_MODULE(module_name, obj_module, enabled_define)
# These are used to generate a header with the required entries for
# "mp_rom_map_elem_t mp_builtin_module_table[]" in py/objmodule.c
from __future__ import print_function
Reported by Pylint.
Line: 29
Column: 9
c_file = None
relative_c_file = os.path.splitext(obj_file)[0] + ".c"
relative_c_file = relative_c_file.lstrip("/\\")
for p in vpath:
possible_c_file = os.path.join(p, relative_c_file)
if os.path.exists(possible_c_file):
c_file = possible_c_file
break
Reported by Pylint.
Line: 44
Column: 5
:param str c_file: path to c file to check
:return: List[(module_name, obj_module, enabled_define)]
"""
global pattern
if c_file is None:
# No c file to match the object file, skip
return set()
Reported by Pylint.
Line: 71
Column: 1
(
"#if ({enabled_define})\n"
" extern const struct _mp_obj_module_t {obj_module};\n"
" #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\n"
"#else\n"
" #define {mod_def}\n"
"#endif\n"
).format(
module_name=module_name,
Reported by Pylint.
Line: 91
Column: 1
print("// MICROPY_REGISTERED_MODULES")
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--vpath", default=".", help="comma separated list of folders to search for c files in"
)
parser.add_argument("files", nargs="*", help="list of c files to search")
Reported by Pylint.
tests/internal_bench/var-5-class-attr.py
6 issues
Line: 8
Column: 10
num = 20000000
def test(num):
i = 0
while i < Foo.num:
i += 1
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
num = 20000000
def test(num):
i = 0
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
num = 20000000
def test(num):
i = 0
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
num = 20000000
def test(num):
i = 0
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
num = 20000000
def test(num):
i = 0
Reported by Pylint.
Line: 8
Column: 1
num = 20000000
def test(num):
i = 0
while i < Foo.num:
i += 1
Reported by Pylint.
tests/extmod/framebuf4.py
6 issues
Line: 5
Column: 5
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
def printbuf():
print("--8<--")
for y in range(h):
Reported by Pylint.
Line: 1
Column: 1
try:
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
def printbuf():
print("--8<--")
Reported by Pylint.
Line: 8
Column: 1
raise SystemExit
def printbuf():
print("--8<--")
for y in range(h):
print(buf[y * w // 2 : (y + 1) * w // 2])
print("-->8--")
Reported by Pylint.
Line: 10
Column: 9
def printbuf():
print("--8<--")
for y in range(h):
print(buf[y * w // 2 : (y + 1) * w // 2])
print("-->8--")
w = 16
Reported by Pylint.
Line: 15
Column: 1
print("-->8--")
w = 16
h = 8
buf = bytearray(w * h // 2)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS4_HMSB)
# fill
Reported by Pylint.
Line: 16
Column: 1
w = 16
h = 8
buf = bytearray(w * h // 2)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS4_HMSB)
# fill
fbuf.fill(0x0F)
Reported by Pylint.
examples/network/http_client.py
6 issues
Line: 3
Column: 1
try:
import usocket as socket
except:
import socket
def main(use_stream=False):
s = socket.socket()
Reported by Pylint.
Line: 1
Column: 1
try:
import usocket as socket
except:
import socket
def main(use_stream=False):
s = socket.socket()
Reported by Pylint.
Line: 7
Column: 1
import socket
def main(use_stream=False):
s = socket.socket()
ai = socket.getaddrinfo("google.com", 80)
print("Address infos:", ai)
addr = ai[0][-1]
Reported by Pylint.
Line: 8
Column: 5
def main(use_stream=False):
s = socket.socket()
ai = socket.getaddrinfo("google.com", 80)
print("Address infos:", ai)
addr = ai[0][-1]
Reported by Pylint.
Line: 10
Column: 5
def main(use_stream=False):
s = socket.socket()
ai = socket.getaddrinfo("google.com", 80)
print("Address infos:", ai)
addr = ai[0][-1]
print("Connect address:", addr)
s.connect(addr)
Reported by Pylint.
Line: 20
Column: 9
if use_stream:
# MicroPython socket objects support stream (aka file) interface
# directly, but the line below is needed for CPython.
s = s.makefile("rwb", 0)
s.write(b"GET / HTTP/1.0\r\n\r\n")
print(s.read())
else:
s.send(b"GET / HTTP/1.0\r\n\r\n")
print(s.recv(4096))
Reported by Pylint.
tests/internal_bench/func_args-1.1-pos_1.py
6 issues
Line: 4
Column: 10
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 1
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 1
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 4
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 4
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 8
Column: 1
pass
def test(num):
for i in iter(range(num)):
func(i)
bench.run(test)
Reported by Pylint.
tests/internal_bench/func_args-3.1-kw_1.py
6 issues
Line: 4
Column: 10
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 1
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 1
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 4
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 4
Column: 1
import bench
def func(a):
pass
def test(num):
for i in iter(range(num)):
Reported by Pylint.
Line: 8
Column: 1
pass
def test(num):
for i in iter(range(num)):
func(a=i)
bench.run(test)
Reported by Pylint.
tests/wipy/modwipy.py
6 issues
Line: 6
Column: 1
"""
import os
import wipy
mch = os.uname().machine
if not "LaunchPad" in mch and not "WiPy" in mch:
raise Exception("Board not supported!")
Reported by Pylint.
Line: 8
Column: 7
import os
import wipy
mch = os.uname().machine
if not "LaunchPad" in mch and not "WiPy" in mch:
raise Exception("Board not supported!")
print(wipy.heartbeat() == True)
wipy.heartbeat(False)
Reported by Pylint.
Line: 20
Column: 1
try:
wipy.heartbeat(True, 1)
except:
print("Exception")
Reported by Pylint.
Line: 12
Column: 7
if not "LaunchPad" in mch and not "WiPy" in mch:
raise Exception("Board not supported!")
print(wipy.heartbeat() == True)
wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)
Reported by Pylint.
Line: 14
Column: 7
print(wipy.heartbeat() == True)
wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)
try:
wipy.heartbeat(True, 1)
Reported by Pylint.
Line: 16
Column: 7
wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)
try:
wipy.heartbeat(True, 1)
except:
print("Exception")
Reported by Pylint.