The following issues were found
tests/inlineasm/asmfpaddsub.py
34 issues
Line: 1
Column: 2
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 3
Column: 10
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 3
Column: 5
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 4
Column: 22
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 4
Column: 5
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 4
Column: 18
@micropython.asm_thumb # r0 = r0+r1-r2
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
Reported by Pylint.
Line: 5
Column: 5
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
vsub(s0, s0, s2)
Reported by Pylint.
Line: 5
Column: 10
def add_sub(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
vsub(s0, s0, s2)
Reported by Pylint.
Line: 6
Column: 22
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
vsub(s0, s0, s2)
vcvt_s32_f32(s31, s0)
Reported by Pylint.
Line: 6
Column: 18
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vadd(s0, s0, s1)
vsub(s0, s0, s2)
vcvt_s32_f32(s31, s0)
Reported by Pylint.
tests/inlineasm/asmfpmuldiv.py
34 issues
Line: 1
Column: 2
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 3
Column: 10
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 3
Column: 5
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 4
Column: 5
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 4
Column: 22
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 4
Column: 18
@micropython.asm_thumb # r0 = (int)(r0*r1/r2)
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
Reported by Pylint.
Line: 5
Column: 10
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
vdiv(s8, s7, s2)
Reported by Pylint.
Line: 5
Column: 5
def muldiv(r0, r1, r2):
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
vdiv(s8, s7, s2)
Reported by Pylint.
Line: 6
Column: 5
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
vdiv(s8, s7, s2)
vcvt_s32_f32(s31, s8)
Reported by Pylint.
Line: 6
Column: 22
vmov(s0, r0)
vcvt_f32_s32(s0, s0)
vmov(s1, r1)
vcvt_f32_s32(s1, s1)
vmov(s2, r2)
vcvt_f32_s32(s2, s2)
vmul(s7, s0, s1)
vdiv(s8, s7, s2)
vcvt_s32_f32(s31, s8)
Reported by Pylint.
ports/cc3200/tools/update-wipy.py
34 issues
Line: 21
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b402-import-ftplib
import argparse
import time
import socket
from ftplib import FTP
from telnetlib import Telnet
def print_exception(e):
print("Exception: {}, on line {}".format(e, sys.exc_info()[-1].tb_lineno))
Reported by Bandit.
Line: 22
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b401-import-telnetlib
import time
import socket
from ftplib import FTP
from telnetlib import Telnet
def print_exception(e):
print("Exception: {}, on line {}".format(e, sys.exc_info()[-1].tb_lineno))
Reported by Bandit.
Line: 39
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b321-ftplib
def transfer_file(args):
with FTP(args.ip, timeout=20) as ftp:
print("FTP connection established")
if "230" in ftp.login(args.user, args.password):
print("Login successful")
Reported by Bandit.
Line: 76
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b312-telnetlib
success = False
try:
tn = Telnet(args.ip, timeout=5)
print("Connected via Telnet, trying to login now")
if b"Login as:" in tn.read_until(b"Login as:", timeout=5):
tn.write(bytes(args.user, "ascii") + b"\r\n")
Reported by Bandit.
Line: 134
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b312-telnetlib
try:
# Specify a longer time out value here because the board has just been
# reset and the wireless connection might not be fully established yet
tn = Telnet(args.ip, timeout=10)
print("Connected via telnet again, lets check the git tag")
break
except socket.timeout:
if retries < 5:
print("Timeout while connecting via telnet, retrying...")
Reported by Bandit.
Line: 107
Column: 12
else:
print("Error: telnet login failed")
except Exception as e:
print_exception(e)
finally:
try:
tn.close()
except Exception as e:
Reported by Pylint.
Line: 112
Column: 16
finally:
try:
tn.close()
except Exception as e:
pass
return success
def verify_update(args):
Reported by Pylint.
Line: 114
Column: 9
tn.close()
except Exception as e:
pass
return success
def verify_update(args):
success = False
firmware_tag = ""
Reported by Pylint.
Line: 165
Column: 12
success = find_tag(bline)
break
except Exception as e:
print_exception(e)
finally:
try:
tn.close()
except Exception as e:
Reported by Pylint.
Line: 170
Column: 16
finally:
try:
tn.close()
except Exception as e:
pass
return success
def main():
Reported by Pylint.
tests/multi_bluetooth/perf_gatt_char_write.py
34 issues
Line: 3
Column: 1
# Write characteristic from central to peripheral and time data rate.
from micropython import const
import time, machine, bluetooth
TIMEOUT_MS = 2000
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNECT = const(2)
Reported by Pylint.
Line: 4
Column: 1
# Write characteristic from central to peripheral and time data rate.
from micropython import const
import time, machine, bluetooth
TIMEOUT_MS = 2000
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNECT = const(2)
Reported by Pylint.
Line: 4
Column: 1
# Write characteristic from central to peripheral and time data rate.
from micropython import const
import time, machine, bluetooth
TIMEOUT_MS = 2000
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNECT = const(2)
Reported by Pylint.
Line: 63
Column: 10
def wait_for_event(event, timeout_ms):
t0 = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
if event in waiting_events:
return waiting_events.pop(event)
machine.idle()
raise ValueError("Timeout waiting for {}".format(event))
Reported by Pylint.
Line: 64
Column: 11
def wait_for_event(event, timeout_ms):
t0 = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
if event in waiting_events:
return waiting_events.pop(event)
machine.idle()
raise ValueError("Timeout waiting for {}".format(event))
Reported by Pylint.
Line: 64
Column: 27
def wait_for_event(event, timeout_ms):
t0 = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
if event in waiting_events:
return waiting_events.pop(event)
machine.idle()
raise ValueError("Timeout waiting for {}".format(event))
Reported by Pylint.
Line: 73
Column: 5
# Acting in peripheral role.
def instance0():
multitest.globals(BDADDR=ble.config("mac"))
((char_handle,),) = ble.gatts_register_services(SERVICES)
ble.gatts_set_buffer(char_handle, _CHAR_SIZE)
print("gap_advertise")
ble.gap_advertise(20_000, b"\x02\x01\x06\x04\xffMPY")
multitest.next()
Reported by Pylint.
Line: 78
Column: 5
ble.gatts_set_buffer(char_handle, _CHAR_SIZE)
print("gap_advertise")
ble.gap_advertise(20_000, b"\x02\x01\x06\x04\xffMPY")
multitest.next()
try:
# Wait for central to connect to us.
conn_handle = wait_for_event(_IRQ_CENTRAL_CONNECT, TIMEOUT_MS)
# Wait for central to disconnect us.
wait_for_event(_IRQ_CENTRAL_DISCONNECT, 30000)
Reported by Pylint.
Line: 93
Column: 5
def instance1():
global packet_sequence
((char_handle,),) = ble.gatts_register_services(SERVICES)
multitest.next()
try:
# Connect to peripheral and then disconnect.
print("gap_connect")
ble.config(mtu=_MTU_SIZE)
ble.gap_connect(*BDADDR)
Reported by Pylint.
Line: 98
Column: 26
# Connect to peripheral and then disconnect.
print("gap_connect")
ble.config(mtu=_MTU_SIZE)
ble.gap_connect(*BDADDR)
conn_handle = wait_for_event(_IRQ_PERIPHERAL_CONNECT, TIMEOUT_MS)
ble.gattc_exchange_mtu(conn_handle)
# Discover characteristics.
ble.gattc_discover_characteristics(conn_handle, 1, 65535)
Reported by Pylint.
tests/micropython/viper_binop_bitwise_uint.py
33 issues
Line: 4
Column: 2
# test bitwise operators on uint type
@micropython.viper
def shl(x: uint, y: uint) -> uint:
return x << y
print("shl")
Reported by Pylint.
Line: 5
Column: 12
@micropython.viper
def shl(x: uint, y: uint) -> uint:
return x << y
print("shl")
print(shl(1, 0))
Reported by Pylint.
Line: 5
Column: 21
@micropython.viper
def shl(x: uint, y: uint) -> uint:
return x << y
print("shl")
print(shl(1, 0))
Reported by Pylint.
Line: 5
Column: 30
@micropython.viper
def shl(x: uint, y: uint) -> uint:
return x << y
print("shl")
print(shl(1, 0))
Reported by Pylint.
Line: 15
Column: 2
print(shl(-1, 10) & 0xFFFFFFFF)
@micropython.viper
def shr(x: uint, y: uint) -> uint:
return x >> y
print("shr")
Reported by Pylint.
Line: 16
Column: 12
@micropython.viper
def shr(x: uint, y: uint) -> uint:
return x >> y
print("shr")
print(shr(1, 0))
Reported by Pylint.
Line: 16
Column: 21
@micropython.viper
def shr(x: uint, y: uint) -> uint:
return x >> y
print("shr")
print(shr(1, 0))
Reported by Pylint.
Line: 16
Column: 30
@micropython.viper
def shr(x: uint, y: uint) -> uint:
return x >> y
print("shr")
print(shr(1, 0))
Reported by Pylint.
Line: 26
Column: 2
print(shr(-1, 1) in (0x7FFFFFFF, 0x7FFFFFFF_FFFFFFFF))
@micropython.viper
def and_(x: uint, y: uint):
return x & y, y & x
print("and")
Reported by Pylint.
Line: 27
Column: 22
@micropython.viper
def and_(x: uint, y: uint):
return x & y, y & x
print("and")
print(*and_(1, 0))
Reported by Pylint.
tests/float/cmath_fun_special.py
33 issues
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 4
Column: 5
# test the special functions imported from cmath
try:
from cmath import *
log10
except (ImportError, NameError):
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/wipy/uart_irq.py
33 issues
Line: 5
Column: 1
UART IRQ test for the CC3200 based boards.
"""
from machine import UART
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:
uart_pins = [
[("GP12", "GP13"), ("GP12", "GP13", "GP7", "GP6")],
[("GP16", "GP17"), ("GP16", "GP17", "GP7", "GP6")],
]
Reported by Pylint.
Line: 24
Column: 1
raise Exception("Board not supported!")
# just in case we have stdio duplicated on any of the uarts
os.dupterm(None)
uart0 = UART(0, 1000000, pins=uart_pins[0][0])
uart1 = UART(1, 1000000, pins=uart_pins[1][0])
uart0_int_count = 0
Reported by Pylint.
Line: 55
Column: 1
while not uart1.any():
pass
time.sleep_us(100)
print(uart1.any() == 3)
print(uart1_int_count > 0)
print(uart1_irq.flags() == 0)
print(uart0_irq.flags() == 0)
print(uart1.read() == b"123")
Reported by Pylint.
Line: 67
Column: 1
while not uart0.any():
pass
time.sleep_us(100)
print(uart0.any() == 5)
print(uart0_int_count > 0)
print(uart0_irq.flags() == 0)
print(uart1_irq.flags() == 0)
print(uart0.read() == b"12345")
Reported by Pylint.
Line: 81
Column: 1
while not uart1.any():
pass
time.sleep_us(100)
print(uart1.any() == 3)
print(uart1_int_count > 0)
print(uart1_irq.flags() == 0)
print(uart0_irq.flags() == 0)
print(uart1.read() == b"123")
Reported by Pylint.
Line: 97
Column: 1
while not uart1.any():
pass
time.sleep_us(100)
print(uart1.any() == 3)
print(uart1_int_count == 0) # no interrupt triggered this time
print(uart1_irq.flags() == 0)
print(uart0_irq.flags() == 0)
print(uart1.read() == b"123")
Reported by Pylint.
Line: 113
Column: 1
while not uart1.any():
pass
time.sleep_us(100)
print(uart1.any() == 3)
print(uart1_int_count > 0)
print(uart1_irq.flags() == 0)
print(uart0_irq.flags() == 0)
print(uart1.read() == b"123")
Reported by Pylint.
Line: 128
Column: 1
while not uart1.any():
pass
time.sleep_us(100)
print(uart1.any() == 3)
print(uart1_int_count == 0) # no interrupt handler called
print(uart1_irq.flags() == 0)
print(uart0_irq.flags() == 0)
print(uart1.read() == b"123")
Reported by Pylint.
Line: 152
Column: 53
print("Exception")
try:
uart0_irq = uart0.irq(trigger=UART.RX_ANY, wake=Sleep.SUSPENDED)
except:
print("Exception")
uart0_irq.disable()
uart1_irq.disable()
Reported by Pylint.
tests/basics/builtin_property.py
33 issues
Line: 6
Column: 5
property
except:
print("SKIP")
raise SystemExit
# create a property object explicitly
property()
property(1, 2, 3)
Reported by Pylint.
Line: 1
Column: 1
# test builtin property
try:
property
except:
print("SKIP")
raise SystemExit
# create a property object explicitly
property()
Reported by Pylint.
Line: 19
Column: 1
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
Reported by Pylint.
Line: 19
Column: 1
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
Reported by Pylint.
Line: 19
Column: 1
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
Reported by Pylint.
Line: 24
Column: 5
self._x = x
@property
def x(self):
print("x get")
return self._x
a = A(1)
print(a.x)
Reported by Pylint.
Line: 24
Column: 5
self._x = x
@property
def x(self):
print("x get")
return self._x
a = A(1)
print(a.x)
Reported by Pylint.
Line: 32
Column: 5
print(a.x)
try:
a.x = 2
except AttributeError:
print("AttributeError")
# explicit use within a class
class B:
Reported by Pylint.
Line: 37
Column: 1
print("AttributeError")
# explicit use within a class
class B:
def __init__(self, x):
self._x = x
def xget(self):
print("x get")
Reported by Pylint.
Line: 37
Column: 1
print("AttributeError")
# explicit use within a class
class B:
def __init__(self, x):
self._x = x
def xget(self):
print("x get")
Reported by Pylint.
tests/net_hosted/connect_nonblock_xfer.py
33 issues
Line: 7
Column: 1
try:
import sys, time
import uerrno as errno, usocket as socket, ussl as ssl
except:
import socket, errno, ssl
isMP = sys.implementation.name == "micropython"
def dp(e):
Reported by Pylint.
Line: 12
Column: 8
isMP = sys.implementation.name == "micropython"
def dp(e):
# uncomment next line for development and testing, to print the actual exceptions
# print(repr(e))
pass
Reported by Pylint.
Line: 35
Column: 21
if tls:
try:
if sys.implementation.name == "micropython":
s = ssl.wrap_socket(s, do_handshake=handshake)
else:
s = ssl.wrap_socket(s, do_handshake_on_connect=handshake)
print("wrap: True")
except Exception as e:
dp(e)
Reported by Pylint.
Line: 37
Column: 21
if sys.implementation.name == "micropython":
s = ssl.wrap_socket(s, do_handshake=handshake)
else:
s = ssl.wrap_socket(s, do_handshake_on_connect=handshake)
print("wrap: True")
except Exception as e:
dp(e)
print("wrap:", e)
elif handshake:
Reported by Pylint.
Line: 39
Column: 16
else:
s = ssl.wrap_socket(s, do_handshake_on_connect=handshake)
print("wrap: True")
except Exception as e:
dp(e)
print("wrap:", e)
elif handshake:
# just sleep a little bit, this allows any connect() errors to happen
time.sleep(0.2)
Reported by Pylint.
Line: 1
Column: 1
# test that socket.connect() on a non-blocking socket raises EINPROGRESS
# and that an immediate write/send/read/recv does the right thing
try:
import sys, time
import uerrno as errno, usocket as socket, ussl as ssl
except:
import socket, errno, ssl
isMP = sys.implementation.name == "micropython"
Reported by Pylint.
Line: 5
Column: 5
# and that an immediate write/send/read/recv does the right thing
try:
import sys, time
import uerrno as errno, usocket as socket, ussl as ssl
except:
import socket, errno, ssl
isMP = sys.implementation.name == "micropython"
Reported by Pylint.
Line: 6
Column: 5
try:
import sys, time
import uerrno as errno, usocket as socket, ussl as ssl
except:
import socket, errno, ssl
isMP = sys.implementation.name == "micropython"
Reported by Pylint.
Line: 8
Column: 5
import sys, time
import uerrno as errno, usocket as socket, ussl as ssl
except:
import socket, errno, ssl
isMP = sys.implementation.name == "micropython"
def dp(e):
# uncomment next line for development and testing, to print the actual exceptions
Reported by Pylint.
Line: 12
Column: 1
isMP = sys.implementation.name == "micropython"
def dp(e):
# uncomment next line for development and testing, to print the actual exceptions
# print(repr(e))
pass
Reported by Pylint.
tests/micropython/viper_binop_arith.py
33 issues
Line: 4
Column: 2
# test arithmetic operators
@micropython.viper
def add(x: int, y: int):
print(x + y)
print(y + x)
Reported by Pylint.
Line: 16
Column: 2
add(-42, -3)
@micropython.viper
def sub(x: int, y: int):
print(x - y)
print(y - x)
Reported by Pylint.
Line: 28
Column: 2
sub(-42, -3)
@micropython.viper
def mul(x: int, y: int):
print(x * y)
print(y * x)
Reported by Pylint.
Line: 42
Column: 2
mul(-9, -6)
@micropython.viper
def shl(x: int, y: int):
print(x << y)
shl(1, 0)
Reported by Pylint.
Line: 54
Column: 2
shl(-42, 10)
@micropython.viper
def shr(x: int, y: int):
print(x >> y)
shr(1, 0)
Reported by Pylint.
Line: 65
Column: 2
shr(-42, 2)
@micropython.viper
def and_(x: int, y: int):
print(x & y, y & x)
and_(1, 0)
Reported by Pylint.
Line: 76
Column: 2
and_(-42, 6)
@micropython.viper
def or_(x: int, y: int):
print(x | y, y | x)
or_(1, 0)
Reported by Pylint.
Line: 86
Column: 2
or_(-42, 5)
@micropython.viper
def xor(x: int, y: int):
print(x ^ y, y ^ x)
xor(1, 0)
Reported by Pylint.
Line: 1
Column: 1
# test arithmetic operators
@micropython.viper
def add(x: int, y: int):
print(x + y)
print(y + x)
Reported by Pylint.
Line: 5
Column: 1
@micropython.viper
def add(x: int, y: int):
print(x + y)
print(y + x)
add(1, 2)
Reported by Pylint.