The following issues were found
tests/basics/class_dict.py
3 issues
Line: 1
Column: 1
# test __dict__ attribute of a class
if not hasattr(int, "__dict__"):
print("SKIP")
raise SystemExit
# dict of a built-in type
print("from_bytes" in int.__dict__)
Reported by Pylint.
Line: 13
Column: 1
# dict of a user class
class Foo:
a = 1
b = "bar"
d = Foo.__dict__
Reported by Pylint.
Line: 13
Column: 1
# dict of a user class
class Foo:
a = 1
b = "bar"
d = Foo.__dict__
Reported by Pylint.
tests/basics/io_bytesio_ext2.py
3 issues
Line: 9
Column: 8
a = io.BytesIO(b"foobar")
try:
a.seek(-10)
except Exception as e:
# CPython throws ValueError, but MicroPython has consistent stream
# interface, so BytesIO raises the same error as a real file, which
# is OSError(EINVAL).
print(type(e), e.args[0] > 0)
Reported by Pylint.
Line: 1
Column: 1
try:
import uio as io
except ImportError:
import io
a = io.BytesIO(b"foobar")
try:
a.seek(-10)
except Exception as e:
Reported by Pylint.
Line: 9
Column: 1
a = io.BytesIO(b"foobar")
try:
a.seek(-10)
except Exception as e:
# CPython throws ValueError, but MicroPython has consistent stream
# interface, so BytesIO raises the same error as a real file, which
# is OSError(EINVAL).
print(type(e), e.args[0] > 0)
Reported by Pylint.
tests/basics/memoryview_itemsize.py
3 issues
Line: 5
Column: 5
memoryview(b'a').itemsize
except:
print("SKIP")
raise SystemExit
try:
from uarray import array
except ImportError:
try:
from array import array
Reported by Pylint.
Line: 13
Column: 9
from array import array
except ImportError:
print("SKIP")
raise SystemExit
for code in ['b', 'h', 'i', 'q', 'f', 'd']:
print(memoryview(array(code)).itemsize)
# 'l' varies depending on word size of the machine
Reported by Pylint.
Line: 1
Column: 1
try:
memoryview(b'a').itemsize
except:
print("SKIP")
raise SystemExit
try:
from uarray import array
except ImportError:
try:
Reported by Pylint.
tests/float/math_domain_special.py
3 issues
Line: 6
Column: 5
try:
import math
math.erf
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
inf = float("inf")
Reported by Pylint.
Line: 9
Column: 5
math.erf
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
inf = float("inf")
nan = float("nan")
# single argument functions
Reported by Pylint.
Line: 1
Column: 1
# Tests domain errors in special math functions
try:
import math
math.erf
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/basics/bytes_subscr.py
3 issues
Line: 8
Column: 5
print(b'123'[-1])
try:
b'123'[1] = 4
except TypeError:
print('TypeError')
try:
del b'123'[1]
Reported by Pylint.
Line: 13
Column: 9
print('TypeError')
try:
del b'123'[1]
except TypeError:
print('TypeError')
Reported by Pylint.
Line: 1
Column: 1
# test [...] of bytes
print(b'123'[0])
print(b'123'[1])
print(b'123'[-1])
try:
b'123'[1] = 4
except TypeError:
Reported by Pylint.
ports/stm32/boards/PYBD_SF2/manifest.py
3 issues
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
Reported by Pylint.
Line: 2
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
Reported by Pylint.
Line: 1
Column: 1
include("$(PORT_DIR)/boards/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
Reported by Pylint.
tests/net_hosted/accept_nonblock.py
3 issues
Line: 5
Column: 1
try:
import usocket as socket
except:
import socket
s = socket.socket()
s.bind(socket.getaddrinfo("127.0.0.1", 8123)[0][-1])
s.setblocking(False)
Reported by Pylint.
Line: 1
Column: 1
# test that socket.accept() on a non-blocking socket raises EAGAIN
try:
import usocket as socket
except:
import socket
s = socket.socket()
s.bind(socket.getaddrinfo("127.0.0.1", 8123)[0][-1])
Reported by Pylint.
Line: 14
Column: 1
s.listen(1)
try:
s.accept()
except OSError as er:
print(er.errno == 11) # 11 is EAGAIN
s.close()
Reported by Pylint.
tests/extmod/btree_gc.py
3 issues
Line: 7
Column: 5
import btree, uio, gc
except ImportError:
print("SKIP")
raise SystemExit
N = 80
# Create a BytesIO but don't keep a reference to it.
db = btree.open(uio.BytesIO(), pagesize=512)
Reported by Pylint.
Line: 1
Column: 1
# Test btree interaction with the garbage collector.
try:
import btree, uio, gc
except ImportError:
print("SKIP")
raise SystemExit
N = 80
Reported by Pylint.
Line: 4
Column: 5
# Test btree interaction with the garbage collector.
try:
import btree, uio, gc
except ImportError:
print("SKIP")
raise SystemExit
N = 80
Reported by Pylint.
tests/pyb/modstm.py
3 issues
Line: 3
Column: 1
# test stm module
import stm
import pyb
# test storing a full 32-bit number
# turn on then off the A15(=yellow) LED
BSRR = 0x18
stm.mem32[stm.GPIOA + BSRR] = 0x00008000
Reported by Pylint.
Line: 4
Column: 1
# test stm module
import stm
import pyb
# test storing a full 32-bit number
# turn on then off the A15(=yellow) LED
BSRR = 0x18
stm.mem32[stm.GPIOA + BSRR] = 0x00008000
Reported by Pylint.
Line: 1
Column: 1
# test stm module
import stm
import pyb
# test storing a full 32-bit number
# turn on then off the A15(=yellow) LED
BSRR = 0x18
stm.mem32[stm.GPIOA + BSRR] = 0x00008000
Reported by Pylint.
tests/basics/memoryview_intbig.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(array('i', [0x7f000000, -0x80000000]))))
print(list(memoryview(array('I', [0x7f000000, 0x80000000, 0x81000000, 0xffffffff]))))
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.