The following issues were found
tests/extmod/uheapq1.py
8 issues
Line: 2
Column: 5
try:
import uheapq as heapq
except:
try:
import heapq
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 3
Column: 1
try:
import uheapq as heapq
except:
try:
import heapq
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 8
Column: 9
import heapq
except ImportError:
print("SKIP")
raise SystemExit
try:
heapq.heappop([])
except IndexError:
print("IndexError")
Reported by Pylint.
Line: 21
Column: 19
print("TypeError")
def pop_and_print(h):
l = []
while h:
l.append(str(heapq.heappop(h)))
print(" ".join(l))
Reported by Pylint.
Line: 1
Column: 1
try:
import uheapq as heapq
except:
try:
import heapq
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 21
Column: 1
print("TypeError")
def pop_and_print(h):
l = []
while h:
l.append(str(heapq.heappop(h)))
print(" ".join(l))
Reported by Pylint.
Line: 21
Column: 1
print("TypeError")
def pop_and_print(h):
l = []
while h:
l.append(str(heapq.heappop(h)))
print(" ".join(l))
Reported by Pylint.
Line: 22
Column: 5
def pop_and_print(h):
l = []
while h:
l.append(str(heapq.heappop(h)))
print(" ".join(l))
Reported by Pylint.
tests/basics/try_finally_return5.py
7 issues
Line: 11
Column: 25
print(x, i)
finally:
try:
1 / 0
finally:
return 42
finally:
print('return')
return 43
Reported by Pylint.
Line: 13
Column: 25
try:
1 / 0
finally:
return 42
finally:
print('return')
return 43
print(foo(4))
Reported by Pylint.
Line: 16
Column: 17
return 42
finally:
print('return')
return 43
print(foo(4))
Reported by Pylint.
Line: 1
Column: 1
def foo(x):
for i in range(x):
try:
pass
finally:
try:
try:
print(x, i)
finally:
Reported by Pylint.
Line: 1
Column: 1
def foo(x):
for i in range(x):
try:
pass
finally:
try:
try:
print(x, i)
finally:
Reported by Pylint.
Line: 1
Column: 1
def foo(x):
for i in range(x):
try:
pass
finally:
try:
try:
print(x, i)
finally:
Reported by Pylint.
Line: 1
Column: 1
def foo(x):
for i in range(x):
try:
pass
finally:
try:
try:
print(x, i)
finally:
Reported by Pylint.
tests/basics/int_intbig.py
7 issues
Line: 1
Column: 1
# This tests long ints for 32-bit machine
a = 0x1ffffffff
b = 0x100000000
print(a)
print(b)
print(a + b)
print(a - b)
print(b - a)
Reported by Pylint.
Line: 3
Column: 1
# This tests long ints for 32-bit machine
a = 0x1ffffffff
b = 0x100000000
print(a)
print(b)
print(a + b)
print(a - b)
print(b - a)
Reported by Pylint.
Line: 4
Column: 1
# This tests long ints for 32-bit machine
a = 0x1ffffffff
b = 0x100000000
print(a)
print(b)
print(a + b)
print(a - b)
print(b - a)
Reported by Pylint.
Line: 42
Column: 1
print(a)
# Test referential integrity of long ints
a = 0x1ffffffff
b = a
a += 1
print(a)
print(b)
Reported by Pylint.
Line: 43
Column: 1
# Test referential integrity of long ints
a = 0x1ffffffff
b = a
a += 1
print(a)
print(b)
# Bitwise ops on 64-bit
Reported by Pylint.
Line: 50
Column: 1
# Bitwise ops on 64-bit
a = 0x1ffffffffffffffff
b = 0x10000000000000000
print("&", a & b)
print(a | b)
print(a ^ b)
Reported by Pylint.
Line: 51
Column: 1
# Bitwise ops on 64-bit
a = 0x1ffffffffffffffff
b = 0x10000000000000000
print("&", a & b)
print(a | b)
print(a ^ b)
Reported by Pylint.
ports/mimxrt/modules/_boot.py
7 issues
Line: 6
Column: 1
# Note: the flash requires the programming size to be aligned to 256 bytes.
import os
import mimxrt
bdev = mimxrt.Flash()
try:
vfs = os.VfsLfs2(bdev, progsize=256)
Reported by Pylint.
Line: 11
Column: 11
bdev = mimxrt.Flash()
try:
vfs = os.VfsLfs2(bdev, progsize=256)
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
Reported by Pylint.
Line: 13
Column: 5
try:
vfs = os.VfsLfs2(bdev, progsize=256)
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
Reported by Pylint.
Line: 14
Column: 11
vfs = os.VfsLfs2(bdev, progsize=256)
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
Reported by Pylint.
Line: 15
Column: 1
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
Reported by Pylint.
Line: 12
Column: 1
try:
vfs = os.VfsLfs2(bdev, progsize=256)
except:
os.VfsLfs2.mkfs(bdev, progsize=256)
vfs = os.VfsLfs2(bdev, progsize=256)
os.mount(vfs, "/")
Reported by Pylint.
Line: 1
Column: 1
# _boot.py
# Try to mount the filesystem, and format the flash if it doesn't exist.
# Note: the flash requires the programming size to be aligned to 256 bytes.
import os
import mimxrt
bdev = mimxrt.Flash()
Reported by Pylint.
tests/micropython/heapalloc_exc_compressed_emg_exc.py
7 issues
Line: 1
Column: 1
import micropython
# Does the full test from heapalloc_exc_compressed.py but while the heap is
# locked (this can only work when the emergency exception buf is enabled).
# Some ports need to allocate heap for the emgergency exception buffer.
try:
micropython.alloc_emergency_exception_buf(256)
except AttributeError:
Reported by Pylint.
Line: 1
Column: 1
import micropython
# Does the full test from heapalloc_exc_compressed.py but while the heap is
# locked (this can only work when the emergency exception buf is enabled).
# Some ports need to allocate heap for the emgergency exception buffer.
try:
micropython.alloc_emergency_exception_buf(256)
except AttributeError:
Reported by Pylint.
Line: 15
Column: 1
a = set()
def test():
micropython.heap_lock()
try:
name()
except NameError as e:
Reported by Pylint.
Line: 20
Column: 5
try:
name()
except NameError as e:
print(type(e).__name__, e)
try:
a.pop()
except KeyError as e:
Reported by Pylint.
Line: 25
Column: 5
try:
a.pop()
except KeyError as e:
print(type(e).__name__, e)
try:
name()
except NameError as e:
Reported by Pylint.
Line: 30
Column: 5
try:
name()
except NameError as e:
print(e.args[0])
try:
a.pop()
except KeyError as e:
Reported by Pylint.
Line: 35
Column: 5
try:
a.pop()
except KeyError as e:
print(e.args[0])
micropython.heap_unlock()
Reported by Pylint.
tests/basics/int_big_or.py
7 issues
Line: 1
Column: 1
print(0 | (1 << 80))
a = 0xfffffffffffffffffffffffffffff
print(a | (1 << 200))
# test + +
print(0 | (1 << 80))
print((1 << 80) | (1 << 80))
Reported by Pylint.
Line: 3
Column: 1
print(0 | (1 << 80))
a = 0xfffffffffffffffffffffffffffff
print(a | (1 << 200))
# test + +
print(0 | (1 << 80))
print((1 << 80) | (1 << 80))
Reported by Pylint.
Line: 6
Column: 11
a = 0xfffffffffffffffffffffffffffff
print(a | (1 << 200))
# test + +
print(0 | (1 << 80))
print((1 << 80) | (1 << 80))
print((1 << 80) | 0)
Reported by Pylint.
Line: 12
Column: 1
print((1 << 80) | (1 << 80))
print((1 << 80) | 0)
a = 0xfffffffffffffffffffffffffffff
print(a | (1 << 100))
print(a | (1 << 200))
print(a | a == 0)
print(bool(a | a))
Reported by Pylint.
Line: 18
Column: 11
print(a | a == 0)
print(bool(a | a))
# test - +
print((-1 << 80) | (1 << 80))
print((-1 << 80) | 0)
print((-a) | (1 << 100))
Reported by Pylint.
Line: 28
Column: 11
print((-a) | a == 0)
print(bool((-a) | a))
# test + -
print(0 | (-1 << 80))
print((1 << 80) | (-1 << 80))
print(a | (-1 << 100))
Reported by Pylint.
Line: 38
Column: 11
print(a | (-a) == 0)
print(bool(a | (-a)))
# test - -
print((-1 << 80) | (-1 << 80))
print((-a) | (-1 << 100))
print((-a) | (-1 << 200))
Reported by Pylint.
tests/basics/globals_del.py
7 issues
Line: 18
Column: 19
class _C:
def _m(self): pass
MethodType = type(_C()._m)
BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append)
del _f
Reported by Pylint.
Line: 5
Column: 11
1
"""
def _f(): pass
FunctionType = type(_f)
LambdaType = type(lambda: None)
CodeType = None
MappingProxyType = None
SimpleNamespace = None
Reported by Pylint.
Line: 8
Column: 1
def _f(): pass
FunctionType = type(_f)
LambdaType = type(lambda: None)
CodeType = None
MappingProxyType = None
SimpleNamespace = None
def _g():
yield 1
Reported by Pylint.
Line: 9
Column: 1
FunctionType = type(_f)
LambdaType = type(lambda: None)
CodeType = None
MappingProxyType = None
SimpleNamespace = None
def _g():
yield 1
GeneratorType = type(_g())
Reported by Pylint.
Line: 10
Column: 1
LambdaType = type(lambda: None)
CodeType = None
MappingProxyType = None
SimpleNamespace = None
def _g():
yield 1
GeneratorType = type(_g())
Reported by Pylint.
Line: 16
Column: 1
yield 1
GeneratorType = type(_g())
class _C:
def _m(self): pass
MethodType = type(_C()._m)
BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append)
Reported by Pylint.
Line: 17
Column: 19
GeneratorType = type(_g())
class _C:
def _m(self): pass
MethodType = type(_C()._m)
BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append)
Reported by Pylint.
tests/basics/generator_send.py
7 issues
Line: 1
Column: 1
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
Reported by Pylint.
Line: 1
Column: 1
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
Reported by Pylint.
Line: 1
Column: 1
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
Reported by Pylint.
Line: 2
Column: 5
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
Reported by Pylint.
Line: 4
Column: 9
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
Reported by Pylint.
Line: 18
Column: 1
print(g.send(200))
def f2():
print("entering")
for i in range(3):
print(i)
yield
print("returning 1")
Reported by Pylint.
Line: 18
Column: 1
print(g.send(200))
def f2():
print("entering")
for i in range(3):
print(i)
yield
print("returning 1")
Reported by Pylint.
tests/basics/generator_pep479.py
7 issues
Line: 21
Column: 1
print('StopIteration')
# throwing a StopIteration which is uncaught will be converted into a RuntimeError
def gen():
yield 1
yield 2
g = gen()
print(next(g))
try:
Reported by Pylint.
Line: 32
Column: 1
print('RuntimeError')
# throwing a StopIteration through yield from, will be converted to a RuntimeError
def gen():
yield from range(2)
print('should not get here')
g = gen()
print(next(g))
try:
Reported by Pylint.
Line: 1
Column: 1
# tests for correct PEP479 behaviour (introduced in Python 3.5)
# basic case: StopIteration is converted into a RuntimeError
def gen():
yield 1
raise StopIteration
g = gen()
print(next(g))
try:
Reported by Pylint.
Line: 4
Column: 1
# tests for correct PEP479 behaviour (introduced in Python 3.5)
# basic case: StopIteration is converted into a RuntimeError
def gen():
yield 1
raise StopIteration
g = gen()
print(next(g))
try:
Reported by Pylint.
Line: 6
Column: 5
# basic case: StopIteration is converted into a RuntimeError
def gen():
yield 1
raise StopIteration
g = gen()
print(next(g))
try:
next(g)
except RuntimeError:
Reported by Pylint.
Line: 21
Column: 1
print('StopIteration')
# throwing a StopIteration which is uncaught will be converted into a RuntimeError
def gen():
yield 1
yield 2
g = gen()
print(next(g))
try:
Reported by Pylint.
Line: 32
Column: 1
print('RuntimeError')
# throwing a StopIteration through yield from, will be converted to a RuntimeError
def gen():
yield from range(2)
print('should not get here')
g = gen()
print(next(g))
try:
Reported by Pylint.
ports/esp8266/modules/apa102.py
7 issues
Line: 4
Column: 1
# APA102 driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Robert Foss, Daniel Busch
from esp import apa102_write
from neopixel import NeoPixel
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
Reported by Pylint.
Line: 5
Column: 1
# MIT license; Copyright (c) 2016 Robert Foss, Daniel Busch
from esp import apa102_write
from neopixel import NeoPixel
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
Reported by Pylint.
Line: 1
Column: 1
# APA102 driver for MicroPython on ESP8266
# MIT license; Copyright (c) 2016 Robert Foss, Daniel Busch
from esp import apa102_write
from neopixel import NeoPixel
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
Reported by Pylint.
Line: 8
Column: 1
from neopixel import NeoPixel
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
def __init__(self, clock_pin, data_pin, n, bpp=4):
super().__init__(data_pin, n, bpp)
self.clock_pin = clock_pin
Reported by Pylint.
Line: 8
Column: 1
from neopixel import NeoPixel
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
def __init__(self, clock_pin, data_pin, n, bpp=4):
super().__init__(data_pin, n, bpp)
self.clock_pin = clock_pin
Reported by Pylint.
Line: 11
Column: 5
class APA102(NeoPixel):
ORDER = (0, 1, 2, 3)
def __init__(self, clock_pin, data_pin, n, bpp=4):
super().__init__(data_pin, n, bpp)
self.clock_pin = clock_pin
self.clock_pin.init(clock_pin.OUT)
def write(self):
Reported by Pylint.
Line: 16
Column: 5
self.clock_pin = clock_pin
self.clock_pin.init(clock_pin.OUT)
def write(self):
apa102_write(self.clock_pin, self.pin, self.buf)
Reported by Pylint.