The following issues were found
tests/basics/memoryview2.py
3 issues
Line: 6
Column: 5
memoryview
except:
print("SKIP")
raise SystemExit
try:
from uarray import array
except ImportError:
try:
from array import array
Reported by Pylint.
Line: 14
Column: 9
from array import array
except ImportError:
print("SKIP")
raise SystemExit
print(list(memoryview(b'\x7f\x80\x81\xff')))
print(list(memoryview(array('b', [0x7f, -0x80]))))
print(list(memoryview(array('B', [0x7f, 0x80, 0x81, 0xff]))))
print(list(memoryview(array('h', [0x7f00, -0x8000]))))
Reported by Pylint.
Line: 1
Column: 1
# test memoryview accessing maximum values for signed/unsigned elements
try:
memoryview
except:
print("SKIP")
raise SystemExit
try:
from uarray import array
except ImportError:
Reported by Pylint.
tests/float/math_fun_int.py
3 issues
Line: 7
Column: 5
import math
except ImportError:
print("SKIP")
raise SystemExit
for fun in (math.ceil, math.floor, math.trunc):
for x in (-1.6, -0.2, 0, 0.6, 1.4, float("inf"), float("nan")):
try:
print(fun(x))
Reported by Pylint.
Line: 1
Column: 1
# test the math functions that return ints
try:
import math
except ImportError:
print("SKIP")
raise SystemExit
for fun in (math.ceil, math.floor, math.trunc):
Reported by Pylint.
Line: 13
Column: 9
for x in (-1.6, -0.2, 0, 0.6, 1.4, float("inf"), float("nan")):
try:
print(fun(x))
except (ValueError, OverflowError) as e:
print(type(e))
Reported by Pylint.
examples/hwapi/button_led.py
3 issues
Line: 1
Column: 1
import utime
from hwconfig import LED, BUTTON
# Light LED when (and while) a BUTTON is pressed
while 1:
LED.value(BUTTON.value())
# Don't burn CPU
utime.sleep_ms(10)
Reported by Pylint.
Line: 2
Column: 1
import utime
from hwconfig import LED, BUTTON
# Light LED when (and while) a BUTTON is pressed
while 1:
LED.value(BUTTON.value())
# Don't burn CPU
utime.sleep_ms(10)
Reported by Pylint.
Line: 1
Column: 1
import utime
from hwconfig import LED, BUTTON
# Light LED when (and while) a BUTTON is pressed
while 1:
LED.value(BUTTON.value())
# Don't burn CPU
utime.sleep_ms(10)
Reported by Pylint.
tests/micropython/heapalloc_fail_dict.py
3 issues
Line: 3
Column: 1
# test handling of failed heap allocation with dict
import micropython
# create dict
x = 1
micropython.heap_lock()
try:
{x: x}
Reported by Pylint.
Line: 1
Column: 1
# test handling of failed heap allocation with dict
import micropython
# create dict
x = 1
micropython.heap_lock()
try:
{x: x}
Reported by Pylint.
Line: 6
Column: 1
import micropython
# create dict
x = 1
micropython.heap_lock()
try:
{x: x}
except MemoryError:
print("MemoryError: create dict")
Reported by Pylint.
tests/extmod/uhashlib_sha1.py
3 issues
Line: 10
Column: 9
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
raise SystemExit
try:
hashlib.sha1
except AttributeError:
# SHA1 is only available on some ports
Reported by Pylint.
Line: 17
Column: 5
except AttributeError:
# SHA1 is only available on some ports
print("SKIP")
raise SystemExit
sha1 = hashlib.sha1(b"hello")
sha1.update(b"world")
print(sha1.digest())
Reported by Pylint.
Line: 1
Column: 1
try:
import uhashlib as hashlib
except ImportError:
try:
import hashlib
except ImportError:
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
Reported by Pylint.
tests/cpydiff/types_int_subclassconv.py
3 issues
Line: 5
Column: 1
categories: Types,int
description: No int conversion for int-derived types available
cause: Unknown
workaround: Avoid subclassing builtin types unless really needed. Prefer https://en.wikipedia.org/wiki/Composition_over_inheritance .
"""
class A(int):
__add__ = lambda self, other: A(int(self) + other)
Reported by Pylint.
Line: 9
Column: 1
"""
class A(int):
__add__ = lambda self, other: A(int(self) + other)
a = A(42)
print(a + a)
Reported by Pylint.
Line: 9
Column: 1
"""
class A(int):
__add__ = lambda self, other: A(int(self) + other)
a = A(42)
print(a + a)
Reported by Pylint.
tests/micropython/heapalloc_fail_set.py
3 issues
Line: 3
Column: 1
# test handling of failed heap allocation with set
import micropython
# create set
x = 1
micropython.heap_lock()
try:
{x}
Reported by Pylint.
Line: 1
Column: 1
# test handling of failed heap allocation with set
import micropython
# create set
x = 1
micropython.heap_lock()
try:
{x}
Reported by Pylint.
Line: 6
Column: 1
import micropython
# create set
x = 1
micropython.heap_lock()
try:
{x}
except MemoryError:
print("MemoryError: set create")
Reported by Pylint.
tests/micropython/heapalloc_fail_tuple.py
3 issues
Line: 3
Column: 1
# test handling of failed heap allocation with tuple
import micropython
# create tuple
x = 1
micropython.heap_lock()
try:
(x,)
Reported by Pylint.
Line: 1
Column: 1
# test handling of failed heap allocation with tuple
import micropython
# create tuple
x = 1
micropython.heap_lock()
try:
(x,)
Reported by Pylint.
Line: 6
Column: 1
import micropython
# create tuple
x = 1
micropython.heap_lock()
try:
(x,)
except MemoryError:
print("MemoryError: tuple create")
Reported by Pylint.
tests/basics/string1.py
3 issues
Line: 8
Column: 8
print(r'abc')
print(u'abc')
print(repr('\a\b\t\n\v\f\r'))
print('\z') # unrecognised escape char
# construction
print(str())
print(str('abc'))
Reported by Pylint.
Line: 1
Column: 1
# basic strings
# literals
print('abc')
print(r'abc')
print(u'abc')
print(repr('\a\b\t\n\v\f\r'))
print('\z') # unrecognised escape char
Reported by Pylint.
Line: 15
Column: 1
print(str('abc'))
# inplace addition
x = 'abc'
print(x)
x += 'def'
print(x)
# binary ops
Reported by Pylint.
tests/basics/array_micropython.py
3 issues
Line: 9
Column: 9
import array
except ImportError:
print("SKIP")
raise SystemExit
# arrays of objects
a = array.array('O')
a.append(1)
print(a[0])
Reported by Pylint.
Line: 28
Column: 13
if a == b and a not in ["f", "d"]:
continue
try:
array.array(a) == array.array(b)
print('FAIL')
except NotImplementedError:
pass
Reported by Pylint.
Line: 1
Column: 1
# test MicroPython-specific features of array.array
try:
import uarray as array
except ImportError:
try:
import array
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.