The following issues were found
tests/basics/gen_yield_from_throw2.py
3 issues
Line: 1
Column: 1
# outer generator ignores a thrown GeneratorExit (this is allowed)
def gen():
try:
yield 123
except GeneratorExit:
print('GeneratorExit')
def gen2():
Reported by Pylint.
Line: 3
Column: 1
# outer generator ignores a thrown GeneratorExit (this is allowed)
def gen():
try:
yield 123
except GeneratorExit:
print('GeneratorExit')
def gen2():
Reported by Pylint.
Line: 9
Column: 1
except GeneratorExit:
print('GeneratorExit')
def gen2():
try:
yield from gen()
except GeneratorExit:
print('GeneratorExit outer')
yield 789
Reported by Pylint.
tests/extmod/machine1.py
3 issues
Line: 8
Column: 5
import umachine as machine
except ImportError:
import machine
machine.mem8
except:
print("SKIP")
raise SystemExit
print(machine.mem8)
Reported by Pylint.
Line: 11
Column: 5
machine.mem8
except:
print("SKIP")
raise SystemExit
print(machine.mem8)
try:
machine.mem16[1]
Reported by Pylint.
Line: 1
Column: 1
# test machine module
try:
try:
import umachine as machine
except ImportError:
import machine
machine.mem8
except:
Reported by Pylint.
tests/basics/bytes_mult.py
3 issues
Line: 1
Column: 1
# basic multiplication
print(b'0' * 5)
# check negative, 0, positive; lhs and rhs multiplication
for i in (-4, -2, 0, 2, 4):
print(i * b'12')
print(b'12' * i)
# check that we don't modify existing object
Reported by Pylint.
Line: 10
Column: 1
print(b'12' * i)
# check that we don't modify existing object
a = b'123'
c = a * 3
print(a, c)
Reported by Pylint.
Line: 11
Column: 1
# check that we don't modify existing object
a = b'123'
c = a * 3
print(a, c)
Reported by Pylint.
tests/basics/gen_yield_from_executing.py
3 issues
Line: 1
Column: 1
# yielding from an already executing generator is not allowed
def f():
yield 1
# g here is already executing so this will raise an exception
yield from g
g = f()
Reported by Pylint.
Line: 3
Column: 1
# yielding from an already executing generator is not allowed
def f():
yield 1
# g here is already executing so this will raise an exception
yield from g
g = f()
Reported by Pylint.
Line: 3
Column: 1
# yielding from an already executing generator is not allowed
def f():
yield 1
# g here is already executing so this will raise an exception
yield from g
g = f()
Reported by Pylint.
tests/extmod/uzlib_decompio.py
3 issues
Line: 6
Column: 5
import uio as io
except ImportError:
print("SKIP")
raise SystemExit
# Raw DEFLATE bitstream
buf = io.BytesIO(b"\xcbH\xcd\xc9\xc9\x07\x00")
inp = zlib.DecompIO(buf, -8)
Reported by Pylint.
Line: 1
Column: 1
try:
import uzlib as zlib
import uio as io
except ImportError:
print("SKIP")
raise SystemExit
# Raw DEFLATE bitstream
Reported by Pylint.
Line: 32
Column: 1
inp = zlib.DecompIO(io.BytesIO(b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc0"))
try:
print(inp.read())
except OSError as e:
print(repr(e))
Reported by Pylint.
tests/pyb/pyb_f411.py
3 issues
Line: 3
Column: 1
# test pyb module on F411 MCUs
import os, pyb
if not "STM32F411" in os.uname().machine:
print("SKIP")
raise SystemExit
print(pyb.freq())
Reported by Pylint.
Line: 1
Column: 1
# test pyb module on F411 MCUs
import os, pyb
if not "STM32F411" in os.uname().machine:
print("SKIP")
raise SystemExit
print(pyb.freq())
Reported by Pylint.
Line: 3
Column: 1
# test pyb module on F411 MCUs
import os, pyb
if not "STM32F411" in os.uname().machine:
print("SKIP")
raise SystemExit
print(pyb.freq())
Reported by Pylint.
tests/cpydiff/types_bytes_format.py
3 issues
Line: 7
Column: 7
cause: MicroPython strives to be a more regular implementation, so if both `str` and `bytes` support ``__mod__()`` (the % operator), it makes sense to support ``format()`` for both too. Support for ``__mod__`` can also be compiled out, which leaves only ``format()`` for bytes formatting.
workaround: If you are interested in CPython compatibility, don't use ``.format()`` on bytes objects.
"""
print(b"{}".format(1))
Reported by Pylint.
Line: 4
Column: 1
"""
categories: Types,bytes
description: bytes objects support .format() method
cause: MicroPython strives to be a more regular implementation, so if both `str` and `bytes` support ``__mod__()`` (the % operator), it makes sense to support ``format()`` for both too. Support for ``__mod__`` can also be compiled out, which leaves only ``format()`` for bytes formatting.
workaround: If you are interested in CPython compatibility, don't use ``.format()`` on bytes objects.
"""
print(b"{}".format(1))
Reported by Pylint.
Line: 5
Column: 1
categories: Types,bytes
description: bytes objects support .format() method
cause: MicroPython strives to be a more regular implementation, so if both `str` and `bytes` support ``__mod__()`` (the % operator), it makes sense to support ``format()`` for both too. Support for ``__mod__`` can also be compiled out, which leaves only ``format()`` for bytes formatting.
workaround: If you are interested in CPython compatibility, don't use ``.format()`` on bytes objects.
"""
print(b"{}".format(1))
Reported by Pylint.
tests/float/string_format_modulo.py
3 issues
Line: 5
Column: 7
print("%r" % 1.0)
print("%d" % 1.0)
print("%i" % 1.0)
print("%u" % 1.0)
# these 3 have different behaviour in Python 3.x versions
# uPy raises a TypeError, following Python 3.5 (earlier versions don't)
# print("%x" % 18.0)
Reported by Pylint.
Line: 6
Column: 7
print("%d" % 1.0)
print("%i" % 1.0)
print("%u" % 1.0)
# these 3 have different behaviour in Python 3.x versions
# uPy raises a TypeError, following Python 3.5 (earlier versions don't)
# print("%x" % 18.0)
# print("%o" % 18.0)
Reported by Pylint.
Line: 1
Column: 1
print("%s" % 1.0)
print("%r" % 1.0)
print("%d" % 1.0)
print("%i" % 1.0)
print("%u" % 1.0)
# these 3 have different behaviour in Python 3.x versions
# uPy raises a TypeError, following Python 3.5 (earlier versions don't)
Reported by Pylint.
tests/micropython/kbd_intr.py
3 issues
Line: 3
Column: 1
# test the micropython.kbd_intr() function
import micropython
try:
micropython.kbd_intr
except AttributeError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 9
Column: 5
micropython.kbd_intr
except AttributeError:
print("SKIP")
raise SystemExit
# just check we can actually call it
micropython.kbd_intr(3)
Reported by Pylint.
Line: 1
Column: 1
# test the micropython.kbd_intr() function
import micropython
try:
micropython.kbd_intr
except AttributeError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/basics/int_big_or3.py
3 issues
Line: 1
Column: 11
# test - +
print( -97989513389222316022151446562729620153292831887555425160965597396
| 23716683549865351578586448630079789776107310103486834795830390982)
print( -53817081128841898634258263553430908085326601592682411889506742059
| 37042558948907407488299113387826240429667200950043601129661240876)
print( -26167512042587370698808974207700979337713004510730289760097826496
Reported by Pylint.
Line: 1
Column: 1
# test - +
print( -97989513389222316022151446562729620153292831887555425160965597396
| 23716683549865351578586448630079789776107310103486834795830390982)
print( -53817081128841898634258263553430908085326601592682411889506742059
| 37042558948907407488299113387826240429667200950043601129661240876)
print( -26167512042587370698808974207700979337713004510730289760097826496
Reported by Pylint.
Line: 27
Column: 11
print( -40019818573920230246248826511203818792007462193311949166285967147
| 9487909752)
# test + -
print( 97989513389222316022151446562729620153292831887555425160965597396
| -23716683549865351578586448630079789776107310103486834795830390982)
print( 53817081128841898634258263553430908085326601592682411889506742059
Reported by Pylint.