The following issues were found
tests/multi_net/uasyncio_tcp_client_rst.py
18 issues
Line: 35
Column: 5
global ev
ev = asyncio.Event()
server = await asyncio.start_server(handle_connection, "0.0.0.0", PORT)
multitest.next()
async with server:
await asyncio.wait_for(ev.wait(), 10)
def instance0():
Reported by Pylint.
Line: 41
Column: 26
def instance0():
multitest.globals(IP=multitest.get_network_ip())
asyncio.run(main())
def instance1():
if not hasattr(socket, "SO_LINGER"):
Reported by Pylint.
Line: 41
Column: 5
def instance0():
multitest.globals(IP=multitest.get_network_ip())
asyncio.run(main())
def instance1():
if not hasattr(socket, "SO_LINGER"):
Reported by Pylint.
Line: 47
Column: 9
def instance1():
if not hasattr(socket, "SO_LINGER"):
multitest.skip()
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
lgr_onoff = 1
lgr_linger = 0
Reported by Pylint.
Line: 48
Column: 5
def instance1():
if not hasattr(socket, "SO_LINGER"):
multitest.skip()
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
lgr_onoff = 1
lgr_linger = 0
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", lgr_onoff, lgr_linger))
Reported by Pylint.
Line: 50
Column: 34
multitest.skip()
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
lgr_onoff = 1
lgr_linger = 0
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", lgr_onoff, lgr_linger))
s.send(b"GET / HTTP/1.0\r\n\r\n")
time.sleep(0.1)
Reported by Pylint.
Line: 10
Column: 9
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
import struct, time, socket
PORT = 8000
Reported by Pylint.
Line: 32
Column: 5
async def main():
global ev
ev = asyncio.Event()
server = await asyncio.start_server(handle_connection, "0.0.0.0", PORT)
multitest.next()
async with server:
await asyncio.wait_for(ev.wait(), 10)
Reported by Pylint.
Line: 34
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b104_hardcoded_bind_all_interfaces.html
async def main():
global ev
ev = asyncio.Event()
server = await asyncio.start_server(handle_connection, "0.0.0.0", PORT)
multitest.next()
async with server:
await asyncio.wait_for(ev.wait(), 10)
Reported by Bandit.
Line: 1
Column: 1
# Test TCP server with client issuing TCP RST part way through read
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
Reported by Pylint.
tests/thread/mutate_bytearray.py
18 issues
Line: 24
Column: 9
with lock:
global n_finished
n_finished += 1
lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0
Reported by Pylint.
Line: 12
Column: 9
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
Line: 13
Column: 13
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
l = len(ba)
Reported by Pylint.
Line: 23
Column: 9
assert len(ba) >= l + 1
with lock:
global n_finished
n_finished += 1
lock = _thread.allocate_lock()
n_thread = 4
Reported by Pylint.
Line: 1
Column: 1
# test concurrent mutating access to a shared bytearray object
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
import _thread
# the shared bytearray
ba = bytearray()
Reported by Pylint.
Line: 11
Column: 1
ba = bytearray()
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
Line: 11
Column: 1
ba = bytearray()
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
Line: 11
Column: 1
ba = bytearray()
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
Line: 11
Column: 1
ba = bytearray()
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
Line: 11
Column: 1
ba = bytearray()
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
l = len(ba)
ba.append(i)
assert len(ba) >= l + 1
Reported by Pylint.
tests/basics/class_bases.py
18 issues
Line: 1
Column: 1
# test for type.__bases__ implementation
if not hasattr(object, '__bases__'):
print("SKIP")
raise SystemExit
class A:
pass
Reported by Pylint.
Line: 7
Column: 1
print("SKIP")
raise SystemExit
class A:
pass
class B(object):
pass
Reported by Pylint.
Line: 7
Column: 1
print("SKIP")
raise SystemExit
class A:
pass
class B(object):
pass
Reported by Pylint.
Line: 7
Column: 1
print("SKIP")
raise SystemExit
class A:
pass
class B(object):
pass
Reported by Pylint.
Line: 10
Column: 1
class A:
pass
class B(object):
pass
class C(B):
pass
Reported by Pylint.
Line: 10
Column: 1
class A:
pass
class B(object):
pass
class C(B):
pass
Reported by Pylint.
Line: 10
Column: 1
class A:
pass
class B(object):
pass
class C(B):
pass
Reported by Pylint.
Line: 10
Column: 1
class A:
pass
class B(object):
pass
class C(B):
pass
Reported by Pylint.
Line: 13
Column: 1
class B(object):
pass
class C(B):
pass
class D(C, A):
pass
Reported by Pylint.
Line: 13
Column: 1
class B(object):
pass
class C(B):
pass
class D(C, A):
pass
Reported by Pylint.
tests/float/float1.py
18 issues
Line: 98
Column: 5
# unsupported unary ops
try:
~1.2
except TypeError:
print("TypeError")
try:
1.2 in 3.4
Reported by Pylint.
Line: 103
Column: 12
print("TypeError")
try:
1.2 in 3.4
except TypeError:
print("TypeError")
# small int on LHS, float on RHS, unsupported op
try:
Reported by Pylint.
Line: 1
Column: 1
# test basic float capabilities
# literals
print(0.12)
print(1.0)
print(1.2)
print(0e0)
print(0e0)
print(0e-0)
Reported by Pylint.
Line: 50
Column: 1
print(-(1.2))
# division of integers
x = 1 / 2
print(x)
# /= operator
a = 1
a /= 2
Reported by Pylint.
Line: 54
Column: 1
print(x)
# /= operator
a = 1
a /= 2
print(a)
# floor division
print(1.0 // 2)
Reported by Pylint.
Line: 64
Column: 7
# comparison
print(1.2 <= 3.4)
print(1.2 <= -3.4)
print(1.2 >= 3.4)
print(1.2 >= -3.4)
print(0.0 == False, 1.0 == True)
print(False == 0.0, True == 1.0)
Reported by Pylint.
Line: 66
Column: 7
print(1.2 <= 3.4)
print(1.2 <= -3.4)
print(1.2 >= 3.4)
print(1.2 >= -3.4)
print(0.0 == False, 1.0 == True)
print(False == 0.0, True == 1.0)
# comparison of nan is special
nan = float("nan")
Reported by Pylint.
Line: 67
Column: 7
print(1.2 <= -3.4)
print(1.2 >= 3.4)
print(1.2 >= -3.4)
print(0.0 == False, 1.0 == True)
print(False == 0.0, True == 1.0)
# comparison of nan is special
nan = float("nan")
print(nan == 1.2)
Reported by Pylint.
Line: 67
Column: 21
print(1.2 <= -3.4)
print(1.2 >= 3.4)
print(1.2 >= -3.4)
print(0.0 == False, 1.0 == True)
print(False == 0.0, True == 1.0)
# comparison of nan is special
nan = float("nan")
print(nan == 1.2)
Reported by Pylint.
Line: 67
Column: 21
print(1.2 <= -3.4)
print(1.2 >= 3.4)
print(1.2 >= -3.4)
print(0.0 == False, 1.0 == True)
print(False == 0.0, True == 1.0)
# comparison of nan is special
nan = float("nan")
print(nan == 1.2)
Reported by Pylint.
tests/basics/builtin_callable.py
18 issues
Line: 1
Column: 1
# test builtin callable
# primitives should not be callable
print(callable(None))
print(callable(1))
print(callable([]))
print(callable("dfsd"))
# modules should not be callabe
Reported by Pylint.
Line: 23
Column: 1
print(callable(lambda:None))
# user defined functions should be callable
def f():
pass
print(callable(f))
# types should be callable, but not instances
class A:
Reported by Pylint.
Line: 23
Column: 1
print(callable(lambda:None))
# user defined functions should be callable
def f():
pass
print(callable(f))
# types should be callable, but not instances
class A:
Reported by Pylint.
Line: 28
Column: 1
print(callable(f))
# types should be callable, but not instances
class A:
pass
print(callable(A))
print(callable(A()))
# instances with __call__ method should be callable
Reported by Pylint.
Line: 28
Column: 1
print(callable(f))
# types should be callable, but not instances
class A:
pass
print(callable(A))
print(callable(A()))
# instances with __call__ method should be callable
Reported by Pylint.
Line: 28
Column: 1
print(callable(f))
# types should be callable, but not instances
class A:
pass
print(callable(A))
print(callable(A()))
# instances with __call__ method should be callable
Reported by Pylint.
Line: 34
Column: 1
print(callable(A()))
# instances with __call__ method should be callable
class B:
def __call__(self):
pass
print(callable(B()))
# this checks internal use of callable when extracting members from an instance
Reported by Pylint.
Line: 34
Column: 1
print(callable(A()))
# instances with __call__ method should be callable
class B:
def __call__(self):
pass
print(callable(B()))
# this checks internal use of callable when extracting members from an instance
Reported by Pylint.
Line: 34
Column: 1
print(callable(A()))
# instances with __call__ method should be callable
class B:
def __call__(self):
pass
print(callable(B()))
# this checks internal use of callable when extracting members from an instance
Reported by Pylint.
Line: 40
Column: 1
print(callable(B()))
# this checks internal use of callable when extracting members from an instance
class C:
def f(self):
return "A.f"
class D:
g = C() # g is a value and is not callable
print(callable(D().g))
Reported by Pylint.
ports/stm32/dma.c
18 issues
Line: 677
CWE codes:
788
}
void DMA1_Stream7_IRQHandler(void) {
IRQ_ENTER(DMA1_Stream7_IRQn);
if (dma_handle[dma_id_7] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_7]);
}
IRQ_EXIT(DMA1_Stream7_IRQn);
}
void DMA2_Stream0_IRQHandler(void) {
Reported by Cppcheck.
Line: 678
CWE codes:
788
void DMA1_Stream7_IRQHandler(void) {
IRQ_ENTER(DMA1_Stream7_IRQn);
if (dma_handle[dma_id_7] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_7]);
}
IRQ_EXIT(DMA1_Stream7_IRQn);
}
void DMA2_Stream0_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream0_IRQn);
Reported by Cppcheck.
Line: 684
CWE codes:
788
}
void DMA2_Stream0_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream0_IRQn);
if (dma_handle[dma_id_8] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_8]);
}
IRQ_EXIT(DMA2_Stream0_IRQn);
}
void DMA2_Stream1_IRQHandler(void) {
Reported by Cppcheck.
Line: 685
CWE codes:
788
void DMA2_Stream0_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream0_IRQn);
if (dma_handle[dma_id_8] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_8]);
}
IRQ_EXIT(DMA2_Stream0_IRQn);
}
void DMA2_Stream1_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream1_IRQn);
Reported by Cppcheck.
Line: 691
CWE codes:
788
}
void DMA2_Stream1_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream1_IRQn);
if (dma_handle[dma_id_9] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_9]);
}
IRQ_EXIT(DMA2_Stream1_IRQn);
}
void DMA2_Stream2_IRQHandler(void) {
Reported by Cppcheck.
Line: 692
CWE codes:
788
void DMA2_Stream1_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream1_IRQn);
if (dma_handle[dma_id_9] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_9]);
}
IRQ_EXIT(DMA2_Stream1_IRQn);
}
void DMA2_Stream2_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream2_IRQn);
Reported by Cppcheck.
Line: 698
CWE codes:
788
}
void DMA2_Stream2_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream2_IRQn);
if (dma_handle[dma_id_10] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_10]);
}
IRQ_EXIT(DMA2_Stream2_IRQn);
}
void DMA2_Stream3_IRQHandler(void) {
Reported by Cppcheck.
Line: 699
CWE codes:
788
void DMA2_Stream2_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream2_IRQn);
if (dma_handle[dma_id_10] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_10]);
}
IRQ_EXIT(DMA2_Stream2_IRQn);
}
void DMA2_Stream3_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream3_IRQn);
Reported by Cppcheck.
Line: 705
CWE codes:
788
}
void DMA2_Stream3_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream3_IRQn);
if (dma_handle[dma_id_11] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_11]);
}
IRQ_EXIT(DMA2_Stream3_IRQn);
}
void DMA2_Stream4_IRQHandler(void) {
Reported by Cppcheck.
Line: 706
CWE codes:
788
void DMA2_Stream3_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream3_IRQn);
if (dma_handle[dma_id_11] != NULL) {
HAL_DMA_IRQHandler(dma_handle[dma_id_11]);
}
IRQ_EXIT(DMA2_Stream3_IRQn);
}
void DMA2_Stream4_IRQHandler(void) {
IRQ_ENTER(DMA2_Stream4_IRQn);
Reported by Cppcheck.
tests/extmod/vfs_lfs_mtime.py
18 issues
Line: 6
Column: 5
try:
import utime, uos
utime.time
utime.sleep
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 7
Column: 5
import utime, uos
utime.time
utime.sleep
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 8
Column: 5
utime.time
utime.sleep
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 11
Column: 5
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
Reported by Pylint.
Line: 30
Column: 25
for i in range(len(buf)):
self.data[addr + i] = buf[i]
def ioctl(self, op, arg):
if op == 4: # block count
return len(self.data) // self.ERASE_BLOCK_SIZE
if op == 5: # block size
return self.ERASE_BLOCK_SIZE
if op == 6: # erase block
Reported by Pylint.
Line: 39
Column: 10
return 0
def test(bdev, vfs_class):
print("test", vfs_class)
# Initial format of block device.
vfs_class.mkfs(bdev)
Reported by Pylint.
Line: 1
Column: 1
# Test for VfsLfs using a RAM device, mtime feature
try:
import utime, uos
utime.time
utime.sleep
uos.VfsLfs2
except (ImportError, AttributeError):
Reported by Pylint.
Line: 4
Column: 5
# Test for VfsLfs using a RAM device, mtime feature
try:
import utime, uos
utime.time
utime.sleep
uos.VfsLfs2
except (ImportError, AttributeError):
Reported by Pylint.
Line: 14
Column: 1
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
def __init__(self, blocks):
self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE)
Reported by Pylint.
Line: 20
Column: 5
def __init__(self, blocks):
self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE)
def readblocks(self, block, buf, off):
addr = block * self.ERASE_BLOCK_SIZE + off
for i in range(len(buf)):
buf[i] = self.data[addr + i]
def writeblocks(self, block, buf, off):
Reported by Pylint.
tests/inlineasm/asmrettype.py
18 issues
Line: 4
Column: 2
# test return type of inline asm
@micropython.asm_thumb
def ret_obj(r0) -> object:
pass
ret_obj(print)(1)
Reported by Pylint.
Line: 12
Column: 2
ret_obj(print)(1)
@micropython.asm_thumb
def ret_bool(r0) -> bool:
pass
print(ret_bool(0), ret_bool(1))
Reported by Pylint.
Line: 20
Column: 2
print(ret_bool(0), ret_bool(1))
@micropython.asm_thumb
def ret_int(r0) -> int:
lsl(r0, r0, 29)
print(ret_int(0), hex(ret_int(1)), hex(ret_int(2)), hex(ret_int(4)))
Reported by Pylint.
Line: 22
Column: 5
@micropython.asm_thumb
def ret_int(r0) -> int:
lsl(r0, r0, 29)
print(ret_int(0), hex(ret_int(1)), hex(ret_int(2)), hex(ret_int(4)))
Reported by Pylint.
Line: 28
Column: 2
print(ret_int(0), hex(ret_int(1)), hex(ret_int(2)), hex(ret_int(4)))
@micropython.asm_thumb
def ret_uint(r0) -> uint:
lsl(r0, r0, 29)
print(ret_uint(0), hex(ret_uint(1)), hex(ret_uint(2)), hex(ret_uint(4)))
Reported by Pylint.
Line: 29
Column: 21
@micropython.asm_thumb
def ret_uint(r0) -> uint:
lsl(r0, r0, 29)
print(ret_uint(0), hex(ret_uint(1)), hex(ret_uint(2)), hex(ret_uint(4)))
Reported by Pylint.
Line: 30
Column: 5
@micropython.asm_thumb
def ret_uint(r0) -> uint:
lsl(r0, r0, 29)
print(ret_uint(0), hex(ret_uint(1)), hex(ret_uint(2)), hex(ret_uint(4)))
Reported by Pylint.
Line: 5
Column: 13
@micropython.asm_thumb
def ret_obj(r0) -> object:
pass
ret_obj(print)(1)
Reported by Pylint.
Line: 13
Column: 14
@micropython.asm_thumb
def ret_bool(r0) -> bool:
pass
print(ret_bool(0), ret_bool(1))
Reported by Pylint.
Line: 1
Column: 1
# test return type of inline asm
@micropython.asm_thumb
def ret_obj(r0) -> object:
pass
ret_obj(print)(1)
Reported by Pylint.
tests/extmod/vfs_lfs_error.py
18 issues
Line: 6
Column: 5
try:
import uos
uos.VfsLfs1
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 7
Column: 5
import uos
uos.VfsLfs1
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 10
Column: 5
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
Reported by Pylint.
Line: 29
Column: 25
for i in range(len(buf)):
self.data[addr + i] = buf[i]
def ioctl(self, op, arg):
if op == 4: # block count
return len(self.data) // self.ERASE_BLOCK_SIZE
if op == 5: # block size
return self.ERASE_BLOCK_SIZE
if op == 6: # erase block
Reported by Pylint.
Line: 38
Column: 10
return 0
def test(bdev, vfs_class):
print("test", vfs_class)
# mkfs with too-small block device
try:
vfs_class.mkfs(RAMBlockDevice(1))
Reported by Pylint.
Line: 1
Column: 1
# Test for VfsLittle using a RAM device, testing error handling
try:
import uos
uos.VfsLfs1
uos.VfsLfs2
except (ImportError, AttributeError):
print("SKIP")
Reported by Pylint.
Line: 13
Column: 1
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE = 1024
def __init__(self, blocks):
self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE)
Reported by Pylint.
Line: 19
Column: 5
def __init__(self, blocks):
self.data = bytearray(blocks * self.ERASE_BLOCK_SIZE)
def readblocks(self, block, buf, off):
addr = block * self.ERASE_BLOCK_SIZE + off
for i in range(len(buf)):
buf[i] = self.data[addr + i]
def writeblocks(self, block, buf, off):
Reported by Pylint.
Line: 21
Column: 9
def readblocks(self, block, buf, off):
addr = block * self.ERASE_BLOCK_SIZE + off
for i in range(len(buf)):
buf[i] = self.data[addr + i]
def writeblocks(self, block, buf, off):
addr = block * self.ERASE_BLOCK_SIZE + off
for i in range(len(buf)):
Reported by Pylint.
Line: 24
Column: 5
for i in range(len(buf)):
buf[i] = self.data[addr + i]
def writeblocks(self, block, buf, off):
addr = block * self.ERASE_BLOCK_SIZE + off
for i in range(len(buf)):
self.data[addr + i] = buf[i]
def ioctl(self, op, arg):
Reported by Pylint.
tests/thread/thread_qstr1.py
18 issues
Line: 25
Column: 9
with lock:
global n_finished
n_finished += 1
lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0
Reported by Pylint.
Line: 19
Column: 9
# main thread function
def th(base, n):
for i in range(n):
# this will intern the string and check it
exec("check('%u', %u)" % (base + i, base + i))
with lock:
global n_finished
Reported by Pylint.
Line: 21
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
def th(base, n):
for i in range(n):
# this will intern the string and check it
exec("check('%u', %u)" % (base + i, base + i))
with lock:
global n_finished
n_finished += 1
Reported by Bandit.
Line: 21
Column: 9
def th(base, n):
for i in range(n):
# this will intern the string and check it
exec("check('%u', %u)" % (base + i, base + i))
with lock:
global n_finished
n_finished += 1
Reported by Pylint.
Line: 24
Column: 9
exec("check('%u', %u)" % (base + i, base + i))
with lock:
global n_finished
n_finished += 1
lock = _thread.allocate_lock()
n_thread = 4
Reported by Pylint.
Line: 1
Column: 1
# test concurrent interning of strings
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
try:
import utime as time
except ImportError:
import time
import _thread
Reported by Pylint.
Line: 12
Column: 1
import _thread
# function to check the interned string
def check(s, val):
assert type(s) == str
assert int(s) == val
# main thread function
Reported by Pylint.
Line: 12
Column: 1
import _thread
# function to check the interned string
def check(s, val):
assert type(s) == str
assert int(s) == val
# main thread function
Reported by Pylint.
Line: 13
Column: 12
# function to check the interned string
def check(s, val):
assert type(s) == str
assert int(s) == val
# main thread function
def th(base, n):
Reported by Pylint.
Line: 13
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
# function to check the interned string
def check(s, val):
assert type(s) == str
assert int(s) == val
# main thread function
def th(base, n):
Reported by Bandit.