The following issues were found
Lib/test/test_index.py
162 issues
Line: 105
Column: 44
def test_index(self):
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
Reported by Pylint.
Line: 105
Column: 26
def test_index(self):
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
Reported by Pylint.
Line: 105
Column: 9
def test_index(self):
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
Reported by Pylint.
Line: 106
Column: 26
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
self.n.ind = 2
Reported by Pylint.
Line: 106
Column: 44
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
self.n.ind = 2
Reported by Pylint.
Line: 106
Column: 9
self.o.ind = -2
self.n.ind = 2
self.assertEqual(self.seq[self.n], self.seq[2])
self.assertEqual(self.seq[self.o], self.seq[-2])
def test_slice(self):
self.o.ind = 1
self.o2.ind = 3
self.n.ind = 2
Reported by Pylint.
Line: 113
Column: 9
self.o2.ind = 3
self.n.ind = 2
self.n2.ind = 4
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
def test_slice_bug7532(self):
seqlen = len(self.seq)
self.o.ind = int(seqlen * 1.5)
Reported by Pylint.
Line: 113
Column: 52
self.o2.ind = 3
self.n.ind = 2
self.n2.ind = 4
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
def test_slice_bug7532(self):
seqlen = len(self.seq)
self.o.ind = int(seqlen * 1.5)
Reported by Pylint.
Line: 113
Column: 26
self.o2.ind = 3
self.n.ind = 2
self.n2.ind = 4
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
def test_slice_bug7532(self):
seqlen = len(self.seq)
self.o.ind = int(seqlen * 1.5)
Reported by Pylint.
Line: 114
Column: 26
self.n.ind = 2
self.n2.ind = 4
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
def test_slice_bug7532(self):
seqlen = len(self.seq)
self.o.ind = int(seqlen * 1.5)
self.n.ind = seqlen + 2
Reported by Pylint.
Lib/multiprocessing/connection.py
162 issues
Line: 23
Column: 1
import _multiprocessing
from . import util
from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler
Reported by Pylint.
Line: 25
Column: 1
from . import util
from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler
try:
import _winapi
Reported by Pylint.
Line: 26
Column: 1
from . import util
from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler
try:
import _winapi
from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
Reported by Pylint.
Line: 137
Column: 13
def __del__(self):
if self._handle is not None:
self._close()
def _check_closed(self):
if self._handle is None:
raise OSError("handle is closed")
Reported by Pylint.
Line: 182
Column: 17
"""Close the connection"""
if self._handle is not None:
try:
self._close()
finally:
self._handle = None
def send_bytes(self, buf, offset=0, size=None):
"""Send the bytes data from a bytes-like object"""
Reported by Pylint.
Line: 205
Column: 9
raise ValueError("size is negative")
elif offset + size > n:
raise ValueError("buffer length < offset + size")
self._send_bytes(m[offset:offset + size])
def send(self, obj):
"""Send a (picklable) object"""
self._check_closed()
self._check_writable()
Reported by Pylint.
Line: 211
Column: 9
"""Send a (picklable) object"""
self._check_closed()
self._check_writable()
self._send_bytes(_ForkingPickler.dumps(obj))
def recv_bytes(self, maxlength=None):
"""
Receive bytes data as a bytes object.
"""
Reported by Pylint.
Line: 221
Column: 15
self._check_readable()
if maxlength is not None and maxlength < 0:
raise ValueError("negative maxlength")
buf = self._recv_bytes(maxlength)
if buf is None:
self._bad_message_length()
return buf.getvalue()
def recv_bytes_into(self, buf, offset=0):
Reported by Pylint.
Line: 241
Column: 22
raise ValueError("negative offset")
elif offset > bytesize:
raise ValueError("offset too large")
result = self._recv_bytes()
size = result.tell()
if bytesize < offset + size:
raise BufferTooShort(result.getvalue())
# Message can fit in dest
result.seek(0)
Reported by Pylint.
Line: 255
Column: 15
"""Receive a (picklable) object"""
self._check_closed()
self._check_readable()
buf = self._recv_bytes()
return _ForkingPickler.loads(buf.getbuffer())
def poll(self, timeout=0.0):
"""Whether there is any input available to be read"""
self._check_closed()
Reported by Pylint.
Lib/test/test_signal.py
161 issues
Line: 28
Column: 44
for name in dir(signal):
sig = getattr(signal, name)
if name in {'SIG_DFL', 'SIG_IGN'}:
self.assertIsInstance(sig, signal.Handlers)
elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
self.assertIsInstance(sig, signal.Sigmasks)
elif name.startswith('SIG') and not name.startswith('SIG_'):
self.assertIsInstance(sig, signal.Signals)
elif name.startswith('CTRL_'):
Reported by Pylint.
Line: 30
Column: 44
if name in {'SIG_DFL', 'SIG_IGN'}:
self.assertIsInstance(sig, signal.Handlers)
elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
self.assertIsInstance(sig, signal.Sigmasks)
elif name.startswith('SIG') and not name.startswith('SIG_'):
self.assertIsInstance(sig, signal.Signals)
elif name.startswith('CTRL_'):
self.assertIsInstance(sig, signal.Signals)
self.assertEqual(sys.platform, "win32")
Reported by Pylint.
Line: 32
Column: 44
elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
self.assertIsInstance(sig, signal.Sigmasks)
elif name.startswith('SIG') and not name.startswith('SIG_'):
self.assertIsInstance(sig, signal.Signals)
elif name.startswith('CTRL_'):
self.assertIsInstance(sig, signal.Signals)
self.assertEqual(sys.platform, "win32")
CheckedSignals = enum._old_convert_(
Reported by Pylint.
Line: 34
Column: 44
elif name.startswith('SIG') and not name.startswith('SIG_'):
self.assertIsInstance(sig, signal.Signals)
elif name.startswith('CTRL_'):
self.assertIsInstance(sig, signal.Signals)
self.assertEqual(sys.platform, "win32")
CheckedSignals = enum._old_convert_(
enum.IntEnum, 'Signals', 'signal',
lambda name:
Reported by Pylint.
Line: 45
Column: 48
or name.startswith('CTRL_'),
source=signal,
)
enum._test_simple_enum(CheckedSignals, signal.Signals)
CheckedHandlers = enum._old_convert_(
enum.IntEnum, 'Handlers', 'signal',
lambda name: name in ('SIG_DFL', 'SIG_IGN'),
source=signal,
Reported by Pylint.
Line: 52
Column: 49
lambda name: name in ('SIG_DFL', 'SIG_IGN'),
source=signal,
)
enum._test_simple_enum(CheckedHandlers, signal.Handlers)
Sigmasks = getattr(signal, 'Sigmasks', None)
if Sigmasks is not None:
CheckedSigmasks = enum._old_convert_(
enum.IntEnum, 'Sigmasks', 'signal',
Reported by Pylint.
Line: 83
Column: 36
def test_getsignal(self):
hup = signal.signal(signal.SIGHUP, self.trivial_signal_handler)
self.assertIsInstance(hup, signal.Handlers)
self.assertEqual(signal.getsignal(signal.SIGHUP),
self.trivial_signal_handler)
signal.signal(signal.SIGHUP, hup)
self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
Reported by Pylint.
Line: 103
Column: 23
def test_valid_signals(self):
s = signal.valid_signals()
self.assertIsInstance(s, set)
self.assertIn(signal.Signals.SIGINT, s)
self.assertIn(signal.Signals.SIGALRM, s)
self.assertNotIn(0, s)
self.assertNotIn(signal.NSIG, s)
self.assertLess(len(s), signal.NSIG)
Reported by Pylint.
Line: 104
Column: 23
s = signal.valid_signals()
self.assertIsInstance(s, set)
self.assertIn(signal.Signals.SIGINT, s)
self.assertIn(signal.Signals.SIGALRM, s)
self.assertNotIn(0, s)
self.assertNotIn(signal.NSIG, s)
self.assertLess(len(s), signal.NSIG)
@unittest.skipUnless(sys.executable, "sys.executable required.")
Reported by Pylint.
Line: 133
Column: 23
s = signal.valid_signals()
self.assertIsInstance(s, set)
self.assertGreaterEqual(len(s), 6)
self.assertIn(signal.Signals.SIGINT, s)
self.assertNotIn(0, s)
self.assertNotIn(signal.NSIG, s)
self.assertLess(len(s), signal.NSIG)
def test_issue9324(self):
Reported by Pylint.
Lib/test/test_peepholer.py
161 issues
Line: 97
Column: 9
self.assertInBytecode(func, 'LOAD_CONST', elem)
self.check_lnotab(func)
def f():
'Adding a docstring made this test fail in Py2.5.0'
return None
self.assertNotInBytecode(f, 'LOAD_GLOBAL')
self.assertInBytecode(f, 'LOAD_CONST', None)
Reported by Pylint.
Line: 155
Column: 14
# . . . opcode_with_arg 100 unary_opcode BUILD_TUPLE 1 . . .
# The following would segfault upon compilation
def crater():
(~[
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
Reported by Pylint.
Line: 339
Column: 16
def test_elim_jump_to_uncond_jump(self):
# POP_JUMP_IF_FALSE to JUMP_FORWARD --> POP_JUMP_IF_FALSE to non-jump
def f():
if a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
foo()
else:
Reported by Pylint.
Line: 341
Column: 21
def f():
if a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
foo()
else:
baz()
self.check_jump_targets(f)
Reported by Pylint.
Line: 342
Column: 24
if a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
foo()
else:
baz()
self.check_jump_targets(f)
self.check_lnotab(f)
Reported by Pylint.
Line: 343
Column: 21
# Intentionally use two-line expression to test issue37213.
if (c
or d):
foo()
else:
baz()
self.check_jump_targets(f)
self.check_lnotab(f)
Reported by Pylint.
Line: 345
Column: 17
or d):
foo()
else:
baz()
self.check_jump_targets(f)
self.check_lnotab(f)
def test_elim_jump_to_uncond_jump2(self):
# POP_JUMP_IF_FALSE to JUMP_ABSOLUTE --> POP_JUMP_IF_FALSE to non-jump
Reported by Pylint.
Line: 352
Column: 19
def test_elim_jump_to_uncond_jump2(self):
# POP_JUMP_IF_FALSE to JUMP_ABSOLUTE --> POP_JUMP_IF_FALSE to non-jump
def f():
while a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
a = foo()
self.check_jump_targets(f)
Reported by Pylint.
Line: 354
Column: 21
def f():
while a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
a = foo()
self.check_jump_targets(f)
self.check_lnotab(f)
Reported by Pylint.
Line: 355
Column: 24
while a:
# Intentionally use two-line expression to test issue37213.
if (c
or d):
a = foo()
self.check_jump_targets(f)
self.check_lnotab(f)
def test_elim_jump_to_uncond_jump3(self):
Reported by Pylint.
Lib/unittest/test/test_setups.py
161 issues
Line: 1
Column: 1
import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
Reported by Pylint.
Line: 7
Column: 1
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
Reported by Pylint.
Line: 7
Column: 1
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
Reported by Pylint.
Line: 11
Column: 1
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
Reported by Pylint.
Line: 13
Column: 5
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
suite = unittest.TestSuite()
for case in cases:
Reported by Pylint.
Line: 13
Column: 5
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
suite = unittest.TestSuite()
for case in cases:
Reported by Pylint.
Line: 13
Column: 5
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
suite = unittest.TestSuite()
for case in cases:
Reported by Pylint.
Line: 16
Column: 5
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
suite = unittest.TestSuite()
for case in cases:
tests = unittest.defaultTestLoader.loadTestsFromTestCase(case)
suite.addTests(tests)
Reported by Pylint.
Line: 16
Column: 5
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases):
suite = unittest.TestSuite()
for case in cases:
tests = unittest.defaultTestLoader.loadTestsFromTestCase(case)
suite.addTests(tests)
Reported by Pylint.
Line: 25
Column: 9
runner = self.getRunner()
# creating a nested suite exposes some potential bugs
realSuite = unittest.TestSuite()
realSuite.addTest(suite)
# adding empty suites to the end exposes potential bugs
suite.addTest(unittest.TestSuite())
realSuite.addTest(unittest.TestSuite())
return runner.run(realSuite)
Reported by Pylint.
Lib/ctypes/test/test_byteswap.py
161 issues
Line: 21
Column: 20
def test_X(self):
print(sys.byteorder, file=sys.stderr)
for i in range(32):
bits = BITS()
setattr(bits, "i%s" % i, 1)
dump(bits)
def test_slots(self):
class BigPoint(BigEndianStructure):
Reported by Pylint.
Line: 23
Column: 13
for i in range(32):
bits = BITS()
setattr(bits, "i%s" % i, 1)
dump(bits)
def test_slots(self):
class BigPoint(BigEndianStructure):
__slots__ = ()
_fields_ = [("x", c_int), ("y", c_int)]
Reported by Pylint.
Line: 204
Column: 13
# these fields do not support different byte order:
for typ in c_wchar, c_void_p, POINTER(c_int):
_fields_.append(("x", typ))
class T(base):
pass
self.assertRaises(TypeError, setattr, T, "_fields_", [("x", typ)])
def test_struct_struct(self):
# nested structures with different byteorders
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
Line: 4
Column: 1
import sys, unittest, struct, math, ctypes
from binascii import hexlify
from ctypes import *
def bin(s):
return hexlify(memoryview(s)).decode().upper()
# Each *simple* type that supports different byte orders has an
Reported by Pylint.
PC/layout/main.py
160 issues
Line: 26
Column: 1
# Started directly, so enable relative imports
__path__ = [str(Path(__file__).resolve().parent)]
from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
Reported by Pylint.
Line: 27
Column: 1
__path__ = [str(Path(__file__).resolve().parent)]
from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
Reported by Pylint.
Line: 28
Column: 1
from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
Reported by Pylint.
Line: 29
Column: 1
from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
Reported by Pylint.
Line: 30
Column: 1
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
Reported by Pylint.
Line: 31
Column: 1
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
Reported by Pylint.
Line: 32
Column: 1
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")
Reported by Pylint.
Line: 33
Column: 1
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")
Reported by Pylint.
Line: 34
Column: 1
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")
IDLE_DIRS_ONLY = FileNameSet("idlelib")
Reported by Pylint.
Line: 36
Column: 18
from .support.props import *
from .support.nuspec import *
TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")
IDLE_DIRS_ONLY = FileNameSet("idlelib")
TCLTK_PYDS_ONLY = FileStemSet("tcl*", "tk*", "_tkinter")
Reported by Pylint.
Lib/test/test_complex.py
160 issues
Line: 4
Column: 1
import unittest
import sys
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from random import random
from math import atan2, isnan, copysign
import operator
Reported by Pylint.
Line: 4
Column: 1
import unittest
import sys
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from random import random
from math import atan2, isnan, copysign
import operator
Reported by Pylint.
Line: 491
Column: 9
def __complex__(self):
return self
class complex2(complex):
"""Make sure that __complex__() calls fail if anything other than a
complex is returned"""
def __complex__(self):
return None
Reported by Pylint.
Line: 25
Column: 5
class ComplexTest(unittest.TestCase):
def assertAlmostEqual(self, a, b):
if isinstance(a, complex):
if isinstance(b, complex):
unittest.TestCase.assertAlmostEqual(self, a.real, b.real)
unittest.TestCase.assertAlmostEqual(self, a.imag, b.imag)
else:
Reported by Pylint.
Line: 107
Column: 13
self.check_div(complex(1e-200, 1e-200), 1+0j)
# Just for fun.
for i in range(100):
self.check_div(complex(random(), random()),
complex(random(), random()))
self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)
Reported by Pylint.
Line: 121
Column: 17
def test_truediv_zero_division(self):
for a, b in ZERO_DIVISION:
with self.assertRaises(ZeroDivisionError):
a / b
def test_floordiv(self):
with self.assertRaises(TypeError):
(1+1j) // (1+0j)
with self.assertRaises(TypeError):
Reported by Pylint.
Line: 125
Column: 13
def test_floordiv(self):
with self.assertRaises(TypeError):
(1+1j) // (1+0j)
with self.assertRaises(TypeError):
(1+1j) // 1.0
with self.assertRaises(TypeError):
(1+1j) // 1
with self.assertRaises(TypeError):
Reported by Pylint.
Line: 127
Column: 13
with self.assertRaises(TypeError):
(1+1j) // (1+0j)
with self.assertRaises(TypeError):
(1+1j) // 1.0
with self.assertRaises(TypeError):
(1+1j) // 1
with self.assertRaises(TypeError):
1.0 // (1+0j)
with self.assertRaises(TypeError):
Reported by Pylint.
Line: 129
Column: 13
with self.assertRaises(TypeError):
(1+1j) // 1.0
with self.assertRaises(TypeError):
(1+1j) // 1
with self.assertRaises(TypeError):
1.0 // (1+0j)
with self.assertRaises(TypeError):
1 // (1+0j)
Reported by Pylint.
Line: 131
Column: 13
with self.assertRaises(TypeError):
(1+1j) // 1
with self.assertRaises(TypeError):
1.0 // (1+0j)
with self.assertRaises(TypeError):
1 // (1+0j)
def test_floordiv_zero_division(self):
for a, b in ZERO_DIVISION:
Reported by Pylint.
Lib/idlelib/scrolledlist.py
158 issues
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Line: 1
Column: 1
from tkinter import *
from tkinter.ttk import Frame, Scrollbar
from idlelib import macosx
class ScrolledList:
default = "(None)"
Reported by Pylint.
Lib/sqlite3/test/userfunctions.py
158 issues
Line: 41
Column: 19
if traceback:
strings.append('Traceback')
def decorator(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
# First, run the test with traceback enabled.
with check_tracebacks(self, strings):
func(self, *args, **kwargs)
Reported by Pylint.
Line: 84
Column: 5
def func_returnlonglong():
return 1<<31
def func_raiseexception():
5/0
def func_memoryerror():
raise MemoryError
def func_overflowerror():
raise OverflowError
Reported by Pylint.
Line: 122
Column: 9
class AggrExceptionInInit:
def __init__(self):
5/0
def step(self, x):
pass
def finalize(self):
Reported by Pylint.
Line: 134
Column: 20
def __init__(self):
pass
def step(self, x):
5/0
def finalize(self):
return 42
Reported by Pylint.
Line: 135
Column: 9
pass
def step(self, x):
5/0
def finalize(self):
return 42
class AggrExceptionInFinalize:
Reported by Pylint.
Line: 148
Column: 9
pass
def finalize(self):
5/0
class AggrCheckType:
def __init__(self):
self.val = None
Reported by Pylint.
Line: 407
Column: 20
# See bpo-44304: The destructor of the user function can
# crash if is called without the GIL from the gc functions
dest = sqlite.connect(':memory:')
def md5sum(t):
return
dest.create_function("md5", 1, md5sum)
x = dest("create table lang (name, first_appeared)")
del md5sum, dest
Reported by Pylint.
Line: 501
Column: 13
cur = self.con.cursor()
with self.assertRaises(sqlite.OperationalError) as cm:
cur.execute("select nofinalize(t) from test")
val = cur.fetchone()[0]
self.assertEqual(str(cm.exception), "user-defined aggregate's 'finalize' method raised error")
@with_tracebacks(['__init__', '5/0', 'ZeroDivisionError'])
def test_aggr_exception_in_init(self):
cur = self.con.cursor()
Reported by Pylint.
Line: 509
Column: 13
cur = self.con.cursor()
with self.assertRaises(sqlite.OperationalError) as cm:
cur.execute("select excInit(t) from test")
val = cur.fetchone()[0]
self.assertEqual(str(cm.exception), "user-defined aggregate's '__init__' method raised error")
@with_tracebacks(['step', '5/0', 'ZeroDivisionError'])
def test_aggr_exception_in_step(self):
cur = self.con.cursor()
Reported by Pylint.
Line: 517
Column: 13
cur = self.con.cursor()
with self.assertRaises(sqlite.OperationalError) as cm:
cur.execute("select excStep(t) from test")
val = cur.fetchone()[0]
self.assertEqual(str(cm.exception), "user-defined aggregate's 'step' method raised error")
@with_tracebacks(['finalize', '5/0', 'ZeroDivisionError'])
def test_aggr_exception_in_finalize(self):
cur = self.con.cursor()
Reported by Pylint.