The following issues were found
tests/micropython/import_mpy_native_gc.py
25 issues
Line: 74
Column: 1
# Import the native function.
gc.collect()
from features0 import factorial
# Free the module that contained the function.
del sys.modules["features0"]
# Run a GC cycle which should reclaim the module but not the function.
Reported by Pylint.
Line: 6
Column: 5
try:
import gc, sys, uio, uos
sys.implementation.mpy
uio.IOBase
uos.mount
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 7
Column: 5
import gc, sys, uio, uos
sys.implementation.mpy
uio.IOBase
uos.mount
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 8
Column: 5
sys.implementation.mpy
uio.IOBase
uos.mount
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 11
Column: 5
uos.mount
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class UserFile(uio.IOBase):
def __init__(self, data):
self.data = memoryview(data)
Reported by Pylint.
Line: 25
Column: 21
self.pos += n
return n
def ioctl(self, req, arg):
return 0
class UserFS:
def __init__(self, files):
Reported by Pylint.
Line: 25
Column: 26
self.pos += n
return n
def ioctl(self, req, arg):
return 0
class UserFS:
def __init__(self, files):
Reported by Pylint.
Line: 44
Column: 26
return (32768, 0, 0, 0, 0, 0, 0, 0, 0, 0)
raise OSError
def open(self, path, mode):
return UserFile(self.files[path])
# Pre-compiled examples/natmod/features0 example for various architectures, keyed
# by the required value of sys.implementation.mpy.
Reported by Pylint.
Line: 84
Column: 5
# Allocate lots of fragmented memory to overwrite anything that was just freed by the GC.
for i in range(1000):
[]
# Run the native function, it should not have been freed or overwritten.
print(factorial(10))
# Unmount and undo path addition.
Reported by Pylint.
Line: 1
Column: 1
# Test that native code loaded from a .mpy file is retained after a GC.
try:
import gc, sys, uio, uos
sys.implementation.mpy
uio.IOBase
uos.mount
except (ImportError, AttributeError):
Reported by Pylint.
tests/basics/builtin_dir.py
25 issues
Line: 25
Column: 5
# dir of subclass
class A:
def a():
pass
class B(A):
def b():
pass
d = dir(B())
Reported by Pylint.
Line: 28
Column: 5
def a():
pass
class B(A):
def b():
pass
d = dir(B())
print(d.count('a'), d.count('b'))
# dir of class with multiple bases and a common parent
Reported by Pylint.
Line: 35
Column: 5
# dir of class with multiple bases and a common parent
class C(A):
def c():
pass
class D(B, C):
def d():
pass
d = dir(D())
Reported by Pylint.
Line: 38
Column: 5
def c():
pass
class D(B, C):
def d():
pass
d = dir(D())
print(d.count('a'), d.count('b'), d.count('c'), d.count('d'))
Reported by Pylint.
Line: 1
Column: 1
# test builtin dir
# dir of locals
print('__name__' in dir())
# dir of module
try:
import usys as sys
except ImportError:
Reported by Pylint.
Line: 16
Column: 1
# dir of type
print('append' in dir(list))
class Foo:
def __init__(self):
self.x = 1
foo = Foo()
print('__init__' in dir(foo))
print('x' in dir(foo))
Reported by Pylint.
Line: 16
Column: 1
# dir of type
print('append' in dir(list))
class Foo:
def __init__(self):
self.x = 1
foo = Foo()
print('__init__' in dir(foo))
print('x' in dir(foo))
Reported by Pylint.
Line: 18
Column: 9
class Foo:
def __init__(self):
self.x = 1
foo = Foo()
print('__init__' in dir(foo))
print('x' in dir(foo))
# dir of subclass
Reported by Pylint.
Line: 24
Column: 1
print('x' in dir(foo))
# dir of subclass
class A:
def a():
pass
class B(A):
def b():
pass
Reported by Pylint.
Line: 24
Column: 1
print('x' in dir(foo))
# dir of subclass
class A:
def a():
pass
class B(A):
def b():
pass
Reported by Pylint.
examples/rp2/pio_ws2812.py
24 issues
Line: 4
Column: 1
# Example using PIO to drive a set of WS2812 LEDs.
import array, time
from machine import Pin
import rp2
# Configure the number of WS2812 LEDs.
NUM_LEDS = 8
Reported by Pylint.
Line: 5
Column: 1
import array, time
from machine import Pin
import rp2
# Configure the number of WS2812 LEDs.
NUM_LEDS = 8
Reported by Pylint.
Line: 22
Column: 5
T1 = 2
T2 = 5
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
Reported by Pylint.
Line: 23
Column: 5
T2 = 5
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
Reported by Pylint.
Line: 24
Column: 9
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
Reported by Pylint.
Line: 24
Column: 5
T3 = 3
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
Reported by Pylint.
Line: 25
Column: 9
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
# fmt: on
Reported by Pylint.
Line: 25
Column: 5
wrap_target()
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
# fmt: on
Reported by Pylint.
Line: 26
Column: 5
label("bitloop")
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
# fmt: on
Reported by Pylint.
Line: 27
Column: 5
out(x, 1) .side(0) [T3 - 1]
jmp(not_x, "do_zero") .side(1) [T1 - 1]
jmp("bitloop") .side(1) [T2 - 1]
label("do_zero")
nop() .side(0) [T2 - 1]
wrap()
# fmt: on
Reported by Pylint.
tests/basics/string_fstring.py
24 issues
Line: 8
Column: 7
def h():
return 6
print(f'no interpolation')
print(f"no interpolation")
print(f"""no interpolation""")
x, y = 1, 2
print(f'{x}')
Reported by Pylint.
Line: 9
Column: 7
return 6
print(f'no interpolation')
print(f"no interpolation")
print(f"""no interpolation""")
x, y = 1, 2
print(f'{x}')
print(f'{x:08x}')
Reported by Pylint.
Line: 10
Column: 7
print(f'no interpolation')
print(f"no interpolation")
print(f"""no interpolation""")
x, y = 1, 2
print(f'{x}')
print(f'{x:08x}')
print(f'{x=}')
Reported by Pylint.
Line: 34
Column: 7
# PEP-0498 specifies that '\\' and '#' must be disallowed explicitly, whereas
# MicroPython relies on the syntax error as a result of the substitution.
print(f"\\")
print(f'#')
try:
eval("f'{\}'")
except SyntaxError:
print('SyntaxError')
Reported by Pylint.
Line: 35
Column: 7
# MicroPython relies on the syntax error as a result of the substitution.
print(f"\\")
print(f'#')
try:
eval("f'{\}'")
except SyntaxError:
print('SyntaxError')
try:
Reported by Pylint.
Line: 37
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval
print(f"\\")
print(f'#')
try:
eval("f'{\}'")
except SyntaxError:
print('SyntaxError')
try:
eval("f'{#}'")
except SyntaxError:
Reported by Bandit.
Line: 37
Column: 5
print(f"\\")
print(f'#')
try:
eval("f'{\}'")
except SyntaxError:
print('SyntaxError')
try:
eval("f'{#}'")
except SyntaxError:
Reported by Pylint.
Line: 37
Column: 14
print(f"\\")
print(f'#')
try:
eval("f'{\}'")
except SyntaxError:
print('SyntaxError')
try:
eval("f'{#}'")
except SyntaxError:
Reported by Pylint.
Line: 41
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval
except SyntaxError:
print('SyntaxError')
try:
eval("f'{#}'")
except SyntaxError:
print('SyntaxError')
# PEP-0498 specifies that handling of double braces '{{' or '}}' should
Reported by Bandit.
Line: 41
Column: 5
except SyntaxError:
print('SyntaxError')
try:
eval("f'{#}'")
except SyntaxError:
print('SyntaxError')
# PEP-0498 specifies that handling of double braces '{{' or '}}' should
Reported by Pylint.
tests/wipy/skipped/rtc_irq.py
24 issues
Line: 5
Column: 1
RTC IRQ test for the CC3200 based boards.
"""
from machine import RTC
import machine
import os
import time
mch = os.uname().machine
Reported by Pylint.
Line: 6
Column: 1
"""
from machine import RTC
import machine
import os
import time
mch = os.uname().machine
if not "LaunchPad" in mch and not "WiPy" in mch:
Reported by Pylint.
Line: 35
Column: 1
rtc_irq = rtc.irq(trigger=RTC.ALARM0, handler=alarm_handler)
# active mode
time.sleep_ms(1000)
rtc.alarm_cancel()
print(rtc_irq_count == 2)
rtc_irq_count = 0
rtc.alarm(time=200, repeat=True)
time.sleep_ms(1000)
Reported by Pylint.
Line: 40
Column: 1
print(rtc_irq_count == 2)
rtc_irq_count = 0
rtc.alarm(time=200, repeat=True)
time.sleep_ms(1000)
rtc.alarm_cancel()
print(rtc_irq_count == 5)
rtc_irq_count = 0
rtc.alarm(time=100, repeat=True)
Reported by Pylint.
Line: 46
Column: 1
rtc_irq_count = 0
rtc.alarm(time=100, repeat=True)
time.sleep_ms(1000)
rtc.alarm_cancel()
print(rtc_irq_count == 10)
# deep sleep mode
rtc.alarm_cancel()
Reported by Pylint.
Line: 63
Column: 1
rtc.alarm_cancel()
rtc_irq_count = 0
rtc.alarm(time=100, repeat=False)
time.sleep_ms(250)
print(rtc_irq_count == 1)
rtc.alarm_cancel()
t0 = rtc_ticks_ms(rtc)
rtc.alarm(time=500, repeat=False)
Reported by Pylint.
Line: 15
Column: 18
raise Exception("Board not supported!")
def rtc_ticks_ms(rtc):
timedate = rtc.now()
return (timedate[5] * 1000) + (timedate[6] // 1000)
rtc_irq_count = 0
Reported by Pylint.
Line: 23
Column: 19
rtc_irq_count = 0
def alarm_handler(rtc_o):
global rtc_irq
global rtc_irq_count
if rtc_irq.flags() & RTC.ALARM0:
rtc_irq_count += 1
Reported by Pylint.
Line: 24
Column: 5
def alarm_handler(rtc_o):
global rtc_irq
global rtc_irq_count
if rtc_irq.flags() & RTC.ALARM0:
rtc_irq_count += 1
Reported by Pylint.
Line: 25
Column: 5
def alarm_handler(rtc_o):
global rtc_irq
global rtc_irq_count
if rtc_irq.flags() & RTC.ALARM0:
rtc_irq_count += 1
rtc = RTC()
Reported by Pylint.
tests/wipy/time.py
24 issues
Line: 22
Column: 24
else:
DAYS_PER_MONTH[2] = 28
for day in range(1, DAYS_PER_MONTH[month] + 1):
secs = time.mktime((year, month, day, 0, 0, 0, 0, 0))
if secs != seconds:
print(
"mktime failed for %d-%02d-%02d got %d expected %d"
% (year, month, day, secs, seconds)
)
Reported by Pylint.
Line: 28
Column: 25
"mktime failed for %d-%02d-%02d got %d expected %d"
% (year, month, day, secs, seconds)
)
tuple = time.localtime(seconds)
secs = time.mktime(tuple)
if secs != seconds:
print(
"localtime failed for %d-%02d-%02d got %d expected %d"
% (year, month, day, secs, seconds)
Reported by Pylint.
Line: 29
Column: 24
% (year, month, day, secs, seconds)
)
tuple = time.localtime(seconds)
secs = time.mktime(tuple)
if secs != seconds:
print(
"localtime failed for %d-%02d-%02d got %d expected %d"
% (year, month, day, secs, seconds)
)
Reported by Pylint.
Line: 54
Column: 19
def spot_test(seconds, expected_time):
actual_time = time.localtime(seconds)
for i in range(len(actual_time)):
if actual_time[i] != expected_time[i]:
print(
"time.localtime(", seconds, ") returned", actual_time, "expecting", expected_time
)
Reported by Pylint.
Line: 81
Column: 1
# fmt: on
t1 = time.time()
time.sleep(2)
t2 = time.time()
print(abs(time.ticks_diff(t1, t2) - 2) <= 1)
t1 = time.ticks_ms()
time.sleep_ms(50)
Reported by Pylint.
Line: 83
Column: 11
t1 = time.time()
time.sleep(2)
t2 = time.time()
print(abs(time.ticks_diff(t1, t2) - 2) <= 1)
t1 = time.ticks_ms()
time.sleep_ms(50)
t2 = time.ticks_ms()
print(abs(time.ticks_diff(t1, t2) - 50) <= 1)
Reported by Pylint.
Line: 85
Column: 6
t2 = time.time()
print(abs(time.ticks_diff(t1, t2) - 2) <= 1)
t1 = time.ticks_ms()
time.sleep_ms(50)
t2 = time.ticks_ms()
print(abs(time.ticks_diff(t1, t2) - 50) <= 1)
t1 = time.ticks_us()
Reported by Pylint.
Line: 86
Column: 1
print(abs(time.ticks_diff(t1, t2) - 2) <= 1)
t1 = time.ticks_ms()
time.sleep_ms(50)
t2 = time.ticks_ms()
print(abs(time.ticks_diff(t1, t2) - 50) <= 1)
t1 = time.ticks_us()
time.sleep_us(1000)
Reported by Pylint.
Line: 87
Column: 6
t1 = time.ticks_ms()
time.sleep_ms(50)
t2 = time.ticks_ms()
print(abs(time.ticks_diff(t1, t2) - 50) <= 1)
t1 = time.ticks_us()
time.sleep_us(1000)
t2 = time.ticks_us()
Reported by Pylint.
Line: 88
Column: 11
t1 = time.ticks_ms()
time.sleep_ms(50)
t2 = time.ticks_ms()
print(abs(time.ticks_diff(t1, t2) - 50) <= 1)
t1 = time.ticks_us()
time.sleep_us(1000)
t2 = time.ticks_us()
print(time.ticks_diff(t1, t2) < 1500)
Reported by Pylint.
tests/pyb/adc.py
24 issues
Line: 1
Column: 1
from pyb import ADC, Timer
adct = ADC(16) # Temperature 930 -> 20C
print(str(adct)[:19])
adcv = ADC(17) # Voltage 1500 -> 3.3V
print(adcv)
# read single sample; 2.5V-5V is pass range
val = adcv.read()
Reported by Pylint.
Line: 1
Column: 1
from pyb import ADC, Timer
adct = ADC(16) # Temperature 930 -> 20C
print(str(adct)[:19])
adcv = ADC(17) # Voltage 1500 -> 3.3V
print(adcv)
# read single sample; 2.5V-5V is pass range
val = adcv.read()
Reported by Pylint.
Line: 10
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
# read single sample; 2.5V-5V is pass range
val = adcv.read()
assert val > 1000 and val < 2000
# timer for read_timed
tim = Timer(5, freq=500)
# read into bytearray
Reported by Bandit.
Line: 10
Column: 8
# read single sample; 2.5V-5V is pass range
val = adcv.read()
assert val > 1000 and val < 2000
# timer for read_timed
tim = Timer(5, freq=500)
# read into bytearray
Reported by Pylint.
Line: 20
Column: 12
adcv.read_timed(buf, tim)
print(len(buf))
for i in buf:
assert i > 50 and i < 150
# read into arrays with different element sizes
import array
arv = array.array("h", 25 * [0x7FFF])
Reported by Pylint.
Line: 20
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
adcv.read_timed(buf, tim)
print(len(buf))
for i in buf:
assert i > 50 and i < 150
# read into arrays with different element sizes
import array
arv = array.array("h", 25 * [0x7FFF])
Reported by Bandit.
Line: 23
Column: 1
assert i > 50 and i < 150
# read into arrays with different element sizes
import array
arv = array.array("h", 25 * [0x7FFF])
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
Reported by Pylint.
Line: 23
Column: 1
assert i > 50 and i < 150
# read into arrays with different element sizes
import array
arv = array.array("h", 25 * [0x7FFF])
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
Reported by Pylint.
Line: 29
Column: 12
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
assert i > 1000 and i < 2000
arv = array.array("i", 30 * [-1])
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
Reported by Pylint.
Line: 29
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
assert i > 1000 and i < 2000
arv = array.array("i", 30 * [-1])
adcv.read_timed(arv, tim)
print(len(arv))
for i in arv:
Reported by Bandit.
tests/wipy/timer.py
24 issues
Line: 5
Column: 1
Timer test for the CC3200 based boards.
"""
from machine import Timer
import os
import time
mch = os.uname().machine
if "LaunchPad" in mch:
Reported by Pylint.
Line: 9
Column: 7
import os
import time
mch = os.uname().machine
if "LaunchPad" in mch:
pwm_pin = "GP24"
elif "WiPy" in mch:
pwm_pin = "GP24"
else:
Reported by Pylint.
Line: 57
Column: 1
ch = timer_test.tim.channel(Timer.A, freq=5)
print(ch.freq() == 5)
ch.irq(handler=timer_test.timer_isr, trigger=Timer.TIMEOUT)
time.sleep_ms(1001)
print(timer_test.int_count == 5)
ch.freq(100)
timer_test.int_count = 0
time.sleep_ms(1001)
Reported by Pylint.
Line: 62
Column: 1
ch.freq(100)
timer_test.int_count = 0
time.sleep_ms(1001)
print(timer_test.int_count == 100)
ch.freq(1000)
time.sleep_ms(1500)
timer_test.int_count = 0
Reported by Pylint.
Line: 66
Column: 1
print(timer_test.int_count == 100)
ch.freq(1000)
time.sleep_ms(1500)
timer_test.int_count = 0
time.sleep_ms(2000)
print(timer_test.int_count == 2000)
timer_test.tim.deinit()
Reported by Pylint.
Line: 68
Column: 1
ch.freq(1000)
time.sleep_ms(1500)
timer_test.int_count = 0
time.sleep_ms(2000)
print(timer_test.int_count == 2000)
timer_test.tim.deinit()
timer_test.tim.init(mode=Timer.ONE_SHOT)
ch = timer_test.tim.channel(Timer.A, period=100000)
Reported by Pylint.
Line: 76
Column: 1
ch = timer_test.tim.channel(Timer.A, period=100000)
ch.irq(handler=timer_test.timer_isr, trigger=Timer.TIMEOUT)
timer_test.int_count = 0
time.sleep_ms(101)
print(timer_test.int_count == 1)
time.sleep_ms(101)
print(timer_test.int_count == 1)
timer_test.tim.deinit()
print(timer_test.tim)
Reported by Pylint.
Line: 78
Column: 1
timer_test.int_count = 0
time.sleep_ms(101)
print(timer_test.int_count == 1)
time.sleep_ms(101)
print(timer_test.int_count == 1)
timer_test.tim.deinit()
print(timer_test.tim)
# 32 bit modes
Reported by Pylint.
Line: 111
Column: 22
tim = Timer(0, mode=Timer.PWM)
try:
ch = tim.channel(TIMER_A | TIMER_B, freq=10)
except:
print("Exception")
try:
ch = tim.channel(TIMER_A, freq=4)
Reported by Pylint.
Line: 111
Column: 32
tim = Timer(0, mode=Timer.PWM)
try:
ch = tim.channel(TIMER_A | TIMER_B, freq=10)
except:
print("Exception")
try:
ch = tim.channel(TIMER_A, freq=4)
Reported by Pylint.
tests/basics/class_super.py
24 issues
Line: 26
Column: 1
# test compiler's handling of long expressions with super
class A:
bar = 123
def foo(self):
print('A foo')
return [1, 2, 3]
class B(A):
Reported by Pylint.
Line: 1
Column: 1
class Base:
def __init__(self):
self.a = 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
Reported by Pylint.
Line: 1
Column: 1
class Base:
def __init__(self):
self.a = 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
Reported by Pylint.
Line: 1
Column: 1
class Base:
def __init__(self):
self.a = 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
Reported by Pylint.
Line: 4
Column: 9
class Base:
def __init__(self):
self.a = 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
Reported by Pylint.
Line: 6
Column: 5
def __init__(self):
self.a = 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
def meth(self):
Reported by Pylint.
Line: 9
Column: 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
def meth(self):
print("in Sub meth")
return super().meth()
Reported by Pylint.
Line: 9
Column: 1
def meth(self):
print("in Base meth", self.a)
class Sub(Base):
def meth(self):
print("in Sub meth")
return super().meth()
Reported by Pylint.
Line: 19
Column: 1
a.meth()
# printing super
class A:
def p(self):
print(str(super())[:18])
A().p()
Reported by Pylint.
Line: 19
Column: 1
a.meth()
# printing super
class A:
def p(self):
print(str(super())[:18])
A().p()
Reported by Pylint.
tests/micropython/schedule.py
24 issues
Line: 3
Column: 1
# test micropython.schedule() function
import micropython
try:
micropython.schedule
except AttributeError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 54
Column: 1
# must schedule from within a callback to guarantee that the scheduler is locked.
def callback(arg):
global done
try:
for i in range(100):
micropython.schedule(lambda x: x, None)
except RuntimeError:
Reported by Pylint.
Line: 9
Column: 5
micropython.schedule
except AttributeError:
print("SKIP")
raise SystemExit
# Basic test of scheduling a function.
def callback(arg):
Reported by Pylint.
Line: 15
Column: 5
def callback(arg):
global done
print(arg)
done = True
done = False
Reported by Pylint.
Line: 29
Column: 20
# that they don't execute until the outer callback is finished.
def callback_inner(arg):
global done
print("inner")
done += 1
Reported by Pylint.
Line: 30
Column: 5
def callback_inner(arg):
global done
print("inner")
done += 1
def callback_outer(arg):
Reported by Pylint.
Line: 35
Column: 20
done += 1
def callback_outer(arg):
global done
micropython.schedule(callback_inner, 0)
# need a loop so that the VM can check for pending events
for i in range(2):
pass
Reported by Pylint.
Line: 36
Column: 5
def callback_outer(arg):
global done
micropython.schedule(callback_inner, 0)
# need a loop so that the VM can check for pending events
for i in range(2):
pass
print("outer")
Reported by Pylint.
Line: 39
Column: 9
global done
micropython.schedule(callback_inner, 0)
# need a loop so that the VM can check for pending events
for i in range(2):
pass
print("outer")
done += 1
Reported by Pylint.
Line: 54
Column: 14
# must schedule from within a callback to guarantee that the scheduler is locked.
def callback(arg):
global done
try:
for i in range(100):
micropython.schedule(lambda x: x, None)
except RuntimeError:
Reported by Pylint.