The following issues were found
tests/micropython/const_intbig.py
2 issues
Line: 3
Column: 1
# test constant optimisation, with consts that are bignums
from micropython import const
# check we can make consts from bignums
Z1 = const(0xFFFFFFFF)
Z2 = const(0xFFFFFFFFFFFFFFFF)
print(hex(Z1), hex(Z2))
Reported by Pylint.
Line: 1
Column: 1
# test constant optimisation, with consts that are bignums
from micropython import const
# check we can make consts from bignums
Z1 = const(0xFFFFFFFF)
Z2 = const(0xFFFFFFFFFFFFFFFF)
print(hex(Z1), hex(Z2))
Reported by Pylint.
tests/float/math_domain.py
2 issues
Line: 7
Column: 5
import math
except ImportError:
print("SKIP")
raise SystemExit
inf = float("inf")
nan = float("nan")
# single argument functions
Reported by Pylint.
Line: 1
Column: 1
# Tests domain errors in math functions
try:
import math
except ImportError:
print("SKIP")
raise SystemExit
inf = float("inf")
Reported by Pylint.
tests/basics/bytearray_slice_assign.py
2 issues
Line: 5
Column: 5
bytearray()[:] = bytearray()
except TypeError:
print("SKIP")
raise SystemExit
# test slices; only 2 argument version supported by MicroPython at the moment
x = bytearray(range(10))
# Assignment
Reported by Pylint.
Line: 1
Column: 1
try:
bytearray()[:] = bytearray()
except TypeError:
print("SKIP")
raise SystemExit
# test slices; only 2 argument version supported by MicroPython at the moment
x = bytearray(range(10))
Reported by Pylint.
tests/micropython/heap_lock.py
2 issues
Line: 3
Column: 1
# check that heap_lock/heap_unlock work as expected
import micropython
l = []
l2 = list(range(100))
micropython.heap_lock()
micropython.heap_lock()
Reported by Pylint.
Line: 1
Column: 1
# check that heap_lock/heap_unlock work as expected
import micropython
l = []
l2 = list(range(100))
micropython.heap_lock()
micropython.heap_lock()
Reported by Pylint.
tests/micropython/heap_locked.py
2 issues
Line: 3
Column: 1
# test micropython.heap_locked()
import micropython
if not hasattr(micropython, "heap_locked"):
print("SKIP")
raise SystemExit
micropython.heap_lock()
Reported by Pylint.
Line: 1
Column: 1
# test micropython.heap_locked()
import micropython
if not hasattr(micropython, "heap_locked"):
print("SKIP")
raise SystemExit
micropython.heap_lock()
Reported by Pylint.
tests/basics/bytes_construct_endian.py
2 issues
Line: 10
Column: 9
from array import array
except ImportError:
print("SKIP")
raise SystemExit
# arrays
print(bytes(array('h', [1, 2])))
print(bytes(array('I', [1, 2])))
Reported by Pylint.
Line: 1
Column: 1
# test construction of bytes from different objects
try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
Reported by Pylint.
tests/basics/string_join.py
2 issues
Line: 1
Column: 1
print(','.join(()))
print(','.join(('a',)))
print(','.join(('a', 'b')))
print(','.join([]))
print(','.join(['a']))
print(','.join(['a', 'b']))
print(''.join(''))
Reported by Pylint.
Line: 40
Column: 1
"b")
# the following should not be joined by the compiler
x = 'a'
'b'
print(x)
Reported by Pylint.
tests/float/math_fun_bool.py
2 issues
Line: 7
Column: 5
from math import isfinite, isnan, isinf
except ImportError:
print("SKIP")
raise SystemExit
test_values = [1, 0, -1, 1.0, 0.0, -1.0, float("NaN"), float("Inf"), -float("NaN"), -float("Inf")]
functions = [isfinite, isnan, isinf]
Reported by Pylint.
Line: 1
Column: 1
# Test the bool functions from math
try:
from math import isfinite, isnan, isinf
except ImportError:
print("SKIP")
raise SystemExit
test_values = [1, 0, -1, 1.0, 0.0, -1.0, float("NaN"), float("Inf"), -float("NaN"), -float("Inf")]
Reported by Pylint.
tools/file2h.py
2 issues
Line: 1
Column: 1
# Reads in a text file, and performs the necessary escapes so that it
# can be #included as a static string like:
# static const char string_from_textfile[] =
# #include "build/textfile.h"
# ;
# This script simply prints the escaped string straight to stdout
from __future__ import print_function
Reported by Pylint.
Line: 15
Column: 1
# Can either be set explicitly, or left blank to auto-detect
# Except auto-detect doesn't work because the file has been passed
# through Python text processing, which makes all EOL a \n
line_end = "\\r\\n"
if __name__ == "__main__":
filename = sys.argv[1]
for line in open(filename, "r").readlines():
if not line_end:
Reported by Pylint.
tests/basics/bytearray_decode.py
2 issues
Line: 6
Column: 5
print(bytearray(b'abc').decode())
except AttributeError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 1
Column: 1
try:
print(bytearray(b'').decode())
print(bytearray(b'abc').decode())
except AttributeError:
print("SKIP")
raise SystemExit
Reported by Pylint.