The following issues were found
PC/layout/support/nuspec.py
14 issues
Line: 8
Column: 1
import os
import sys
from .constants import *
__all__ = ["get_nuspec_layout"]
PYTHON_NUSPEC_NAME = "python.nuspec"
Reported by Pylint.
Line: 15
Column: 19
PYTHON_NUSPEC_NAME = "python.nuspec"
NUSPEC_DATA = {
"PYTHON_TAG": VER_DOT,
"PYTHON_VERSION": os.getenv("PYTHON_NUSPEC_VERSION"),
"FILELIST": r' <file src="**\*" exclude="python.png" target="tools" />',
"GIT": sys._git,
}
Reported by Pylint.
Line: 31
Column: 56
if not NUSPEC_DATA["PYTHON_VERSION"]:
NUSPEC_DATA["PYTHON_VERSION"] = "{}.{}{}{}".format(
VER_DOT, VER_MICRO, "-" if VER_SUFFIX else "", VER_SUFFIX
)
FILELIST_WITH_PROPS = r""" <file src="**\*" exclude="python.png;python.props" target="tools" />
<file src="python.props" target="build\native" />"""
Reported by Pylint.
Line: 31
Column: 36
if not NUSPEC_DATA["PYTHON_VERSION"]:
NUSPEC_DATA["PYTHON_VERSION"] = "{}.{}{}{}".format(
VER_DOT, VER_MICRO, "-" if VER_SUFFIX else "", VER_SUFFIX
)
FILELIST_WITH_PROPS = r""" <file src="**\*" exclude="python.png;python.props" target="tools" />
<file src="python.props" target="build\native" />"""
Reported by Pylint.
Line: 31
Column: 18
if not NUSPEC_DATA["PYTHON_VERSION"]:
NUSPEC_DATA["PYTHON_VERSION"] = "{}.{}{}{}".format(
VER_DOT, VER_MICRO, "-" if VER_SUFFIX else "", VER_SUFFIX
)
FILELIST_WITH_PROPS = r""" <file src="**\*" exclude="python.png;python.props" target="tools" />
<file src="python.props" target="build\native" />"""
Reported by Pylint.
Line: 31
Column: 9
if not NUSPEC_DATA["PYTHON_VERSION"]:
NUSPEC_DATA["PYTHON_VERSION"] = "{}.{}{}{}".format(
VER_DOT, VER_MICRO, "-" if VER_SUFFIX else "", VER_SUFFIX
)
FILELIST_WITH_PROPS = r""" <file src="**\*" exclude="python.png;python.props" target="tools" />
<file src="python.props" target="build\native" />"""
Reported by Pylint.
Line: 8
Column: 1
import os
import sys
from .constants import *
__all__ = ["get_nuspec_layout"]
PYTHON_NUSPEC_NAME = "python.nuspec"
Reported by Pylint.
Line: 18
Column: 12
"PYTHON_TAG": VER_DOT,
"PYTHON_VERSION": os.getenv("PYTHON_NUSPEC_VERSION"),
"FILELIST": r' <file src="**\*" exclude="python.png" target="tools" />',
"GIT": sys._git,
}
NUSPEC_PLATFORM_DATA = dict(
_keys=("PYTHON_BITNESS", "PACKAGENAME", "PACKAGETITLE"),
win32=("32-bit", "pythonx86", "Python (32-bit)"),
Reported by Pylint.
Line: 60
Column: 1
"""
def _get_nuspec_data_overrides(ns):
for k, v in zip(NUSPEC_PLATFORM_DATA["_keys"], NUSPEC_PLATFORM_DATA[ns.arch]):
ev = os.getenv("PYTHON_NUSPEC_" + k)
if ev:
yield k, ev
yield k, v
Reported by Pylint.
Line: 61
Column: 12
def _get_nuspec_data_overrides(ns):
for k, v in zip(NUSPEC_PLATFORM_DATA["_keys"], NUSPEC_PLATFORM_DATA[ns.arch]):
ev = os.getenv("PYTHON_NUSPEC_" + k)
if ev:
yield k, ev
yield k, v
Reported by Pylint.
Tools/scripts/pysource.py
14 issues
Line: 33
Column: 11
if debug: print(msg)
def _open(fullpath):
try:
size = os.stat(fullpath).st_size
except OSError as err: # Permission denied - ignore the file
print_debug("%s: permission denied: %s" % (fullpath, err))
return None
Reported by Pylint.
Line: 50
Column: 20
print_debug("%s: access denied: %s" % (fullpath, err))
return None
def has_python_ext(fullpath):
return fullpath.endswith(".py") or fullpath.endswith(".pyw")
def looks_like_python(fullpath):
infile = _open(fullpath)
if infile is None:
Reported by Pylint.
Line: 53
Column: 23
def has_python_ext(fullpath):
return fullpath.endswith(".py") or fullpath.endswith(".pyw")
def looks_like_python(fullpath):
infile = _open(fullpath)
if infile is None:
return False
with infile:
Reported by Pylint.
Line: 74
Column: 21
return False
def can_be_compiled(fullpath):
infile = _open(fullpath)
if infile is None:
return False
with infile:
Reported by Pylint.
Line: 84
Column: 12
try:
compile(code, fullpath, "exec")
except Exception as err:
print_debug("%s: cannot compile: %s" % (fullpath, err))
return False
return True
Reported by Pylint.
Line: 116
Column: 21
if exclude in dirnames:
dirnames.remove(exclude)
for filename in filenames:
fullpath = os.path.join(dirpath, filename)
print_debug("testing: %s" % fullpath)
if is_python(fullpath):
yield fullpath
else:
print_debug(" unknown type")
Reported by Pylint.
Line: 23
Column: 1
__all__ = ["has_python_ext", "looks_like_python", "can_be_compiled", "walk_python_files"]
import os, re
binary_re = re.compile(br'[\x00-\x08\x0E-\x1F\x7F]')
debug = False
Reported by Pylint.
Line: 27
Column: 1
binary_re = re.compile(br'[\x00-\x08\x0E-\x1F\x7F]')
debug = False
def print_debug(msg):
if debug: print(msg)
Reported by Pylint.
Line: 29
Column: 1
debug = False
def print_debug(msg):
if debug: print(msg)
def _open(fullpath):
try:
Reported by Pylint.
Line: 30
Column: 15
debug = False
def print_debug(msg):
if debug: print(msg)
def _open(fullpath):
try:
size = os.stat(fullpath).st_size
Reported by Pylint.
Lib/pipes.py
14 issues
Line: 160
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html
if self.steps[-1][1] == SINK:
raise ValueError('Template.open_r: pipeline ends width SINK')
cmd = self.makepipeline(file, '')
return os.popen(cmd, 'r')
def open_w(self, file):
if not self.steps:
return open(file, 'w')
if self.steps[0][1] == SOURCE:
Reported by Bandit.
Line: 168
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html
if self.steps[0][1] == SOURCE:
raise ValueError('Template.open_w: pipeline begins with SOURCE')
cmd = self.makepipeline('', file)
return os.popen(cmd, 'w')
def copy(self, infile, outfile):
return os.system(self.makepipeline(infile, outfile))
def makepipeline(self, infile, outfile):
Reported by Bandit.
Line: 171
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html
return os.popen(cmd, 'w')
def copy(self, infile, outfile):
return os.system(self.makepipeline(infile, outfile))
def makepipeline(self, infile, outfile):
cmd = makepipeline(infile, self.steps, outfile)
if self.debugging:
print(cmd)
Reported by Bandit.
Line: 102
Column: 9
"""t.clone() returns a new pipeline template with identical
initial state as the current one."""
t = Template()
t.steps = self.steps[:]
t.debugging = self.debugging
return t
def debug(self, flag):
"""t.debug(flag) turns debugging on or off."""
Reported by Pylint.
Line: 185
Column: 5
# Build a list with for each command:
# [input filename or '', command string, kind, output filename or '']
list = []
for cmd, kind in steps:
list.append(['', cmd, kind, ''])
#
# Make sure there is at least one step
#
Reported by Pylint.
Line: 101
Column: 9
def clone(self):
"""t.clone() returns a new pipeline template with identical
initial state as the current one."""
t = Template()
t.steps = self.steps[:]
t.debugging = self.debugging
return t
def debug(self, flag):
Reported by Pylint.
Line: 142
Column: 5
raise ValueError('Template.prepend: missing $OUT in cmd')
self.steps.insert(0, (cmd, kind))
def open(self, file, rw):
"""t.open(file, rw) returns a pipe or file object open for
reading or writing; the file is the other end of the pipeline."""
if rw == 'r':
return self.open_r(file)
if rw == 'w':
Reported by Pylint.
Line: 162
Column: 5
cmd = self.makepipeline(file, '')
return os.popen(cmd, 'r')
def open_w(self, file):
if not self.steps:
return open(file, 'w')
if self.steps[0][1] == SOURCE:
raise ValueError('Template.open_w: pipeline begins with SOURCE')
cmd = self.makepipeline('', file)
Reported by Pylint.
Line: 170
Column: 5
cmd = self.makepipeline('', file)
return os.popen(cmd, 'w')
def copy(self, infile, outfile):
return os.system(self.makepipeline(infile, outfile))
def makepipeline(self, infile, outfile):
cmd = makepipeline(infile, self.steps, outfile)
if self.debugging:
Reported by Pylint.
Line: 173
Column: 5
def copy(self, infile, outfile):
return os.system(self.makepipeline(infile, outfile))
def makepipeline(self, infile, outfile):
cmd = makepipeline(infile, self.steps, outfile)
if self.debugging:
print(cmd)
cmd = 'set -x; ' + cmd
return cmd
Reported by Pylint.
Lib/test/fork_wait.py
14 issues
Line: 69
Column: 20
prefork_lives = self.alive.copy()
if sys.platform in ['unixware7']:
cpid = os.fork1()
else:
cpid = os.fork()
if cpid == 0:
# Child
Reported by Pylint.
Line: 39
Column: 17
self.threads.clear()
threading_helper.threading_cleanup(*self._threading_key)
def f(self, id):
while not self.stop:
self.alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
except OSError:
Reported by Pylint.
Line: 80
Column: 13
for key in self.alive:
if self.alive[key] != prefork_lives[key]:
n += 1
os._exit(n)
else:
# Parent
self.wait_impl(cpid, exitcode=0)
Reported by Pylint.
Line: 12
Column: 1
active threads survive in the child after a fork(); this is an error.
"""
import os, sys, time, unittest
import threading
from test import support
from test.support import threading_helper
Reported by Pylint.
Line: 22
Column: 1
SHORTSLEEP = 0.5
NUM_THREADS = 4
class ForkWait(unittest.TestCase):
def setUp(self):
self._threading_key = threading_helper.threading_setup()
self.alive = {}
self.stop = 0
Reported by Pylint.
Line: 39
Column: 5
self.threads.clear()
threading_helper.threading_cleanup(*self._threading_key)
def f(self, id):
while not self.stop:
self.alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
except OSError:
Reported by Pylint.
Line: 39
Column: 5
self.threads.clear()
threading_helper.threading_cleanup(*self._threading_key)
def f(self, id):
while not self.stop:
self.alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
except OSError:
Reported by Pylint.
Line: 39
Column: 5
self.threads.clear()
threading_helper.threading_cleanup(*self._threading_key)
def f(self, id):
while not self.stop:
self.alive[id] = os.getpid()
try:
time.sleep(SHORTSLEEP)
except OSError:
Reported by Pylint.
Line: 47
Column: 5
except OSError:
pass
def wait_impl(self, cpid, *, exitcode):
support.wait_process(cpid, exitcode=exitcode)
def test_wait(self):
for i in range(NUM_THREADS):
thread = threading.Thread(target=self.f, args=(i,))
Reported by Pylint.
Line: 47
Column: 5
except OSError:
pass
def wait_impl(self, cpid, *, exitcode):
support.wait_process(cpid, exitcode=exitcode)
def test_wait(self):
for i in range(NUM_THREADS):
thread = threading.Thread(target=self.f, args=(i,))
Reported by Pylint.
Lib/test/test_email/test_pickleable.py
14 issues
Line: 35
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle
header = self.header_factory(name, value)
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(header, proto)
h = pickle.loads(p)
self.assertEqual(str(h), str(header))
@parameterize
class TestPickleCopyMessage(TestEmailBase):
Reported by Bandit.
Line: 71
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle
def msg_as_pickle(self, msg):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(msg, proto)
msg2 = pickle.loads(p)
self.assertEqual(msg2.as_string(), msg.as_string())
if __name__ == '__main__':
unittest.main()
Reported by Bandit.
Line: 1
Column: 1
import unittest
import textwrap
import copy
import pickle
import email
import email.message
from email import policy
from email.headerregistry import HeaderRegistry
from test.test_email import TestEmailBase, parameterize
Reported by Pylint.
Line: 4
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b403-import-pickle
import unittest
import textwrap
import copy
import pickle
import email
import email.message
from email import policy
from email.headerregistry import HeaderRegistry
from test.test_email import TestEmailBase, parameterize
Reported by Bandit.
Line: 13
Column: 1
@parameterize
class TestPickleCopyHeader(TestEmailBase):
header_factory = HeaderRegistry()
unstructured = header_factory('subject', 'this is a test')
Reported by Pylint.
Line: 26
Column: 5
'date': ('date', 'Tue, 29 May 2012 09:24:26 +1000'),
}
def header_as_deepcopy(self, name, value):
header = self.header_factory(name, value)
h = copy.deepcopy(header)
self.assertEqual(str(h), str(header))
def header_as_pickle(self, name, value):
Reported by Pylint.
Line: 28
Column: 9
def header_as_deepcopy(self, name, value):
header = self.header_factory(name, value)
h = copy.deepcopy(header)
self.assertEqual(str(h), str(header))
def header_as_pickle(self, name, value):
header = self.header_factory(name, value)
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
Reported by Pylint.
Line: 31
Column: 5
h = copy.deepcopy(header)
self.assertEqual(str(h), str(header))
def header_as_pickle(self, name, value):
header = self.header_factory(name, value)
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(header, proto)
h = pickle.loads(p)
self.assertEqual(str(h), str(header))
Reported by Pylint.
Line: 34
Column: 13
def header_as_pickle(self, name, value):
header = self.header_factory(name, value)
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(header, proto)
h = pickle.loads(p)
self.assertEqual(str(h), str(header))
@parameterize
Reported by Pylint.
Line: 35
Column: 13
header = self.header_factory(name, value)
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
p = pickle.dumps(header, proto)
h = pickle.loads(p)
self.assertEqual(str(h), str(header))
@parameterize
class TestPickleCopyMessage(TestEmailBase):
Reported by Pylint.
Lib/test/ann_module3.py
14 issues
Line: 7
Column: 5
"""
def f_bad_ann():
__annotations__[1] = 2
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
Reported by Pylint.
Line: 11
Column: 17
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
sfel.y: int = 0
Reported by Pylint.
Line: 15
Column: 9
class D_bad_ann:
def __init__(self, x: int) -> None:
sfel.y: int = 0
def g_bad_ann():
no_such_name.attr: int = 0
Reported by Pylint.
Line: 18
Column: 5
sfel.y: int = 0
def g_bad_ann():
no_such_name.attr: int = 0
Reported by Pylint.
Line: 14
Column: 24
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
sfel.y: int = 0
def g_bad_ann():
no_such_name.attr: int = 0
Reported by Pylint.
Line: 6
Column: 1
in a certain manner. More examples are in test_grammar and test_parser.
"""
def f_bad_ann():
__annotations__[1] = 2
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
Reported by Pylint.
Line: 9
Column: 1
def f_bad_ann():
__annotations__[1] = 2
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
Reported by Pylint.
Line: 9
Column: 1
def f_bad_ann():
__annotations__[1] = 2
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
Reported by Pylint.
Line: 9
Column: 1
def f_bad_ann():
__annotations__[1] = 2
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
Reported by Pylint.
Line: 11
Column: 9
class C_OK:
def __init__(self, x: int) -> None:
self.x: no_such_name = x # This one is OK as proposed by Guido
class D_bad_ann:
def __init__(self, x: int) -> None:
sfel.y: int = 0
Reported by Pylint.
Lib/test/test__opcode.py
14 issues
Line: 70
Column: 22
class SpecializationStatsTests(unittest.TestCase):
def test_specialization_stats(self):
stat_names = opcode._specialization_stats
specialized_opcodes = [
op[:-len("_ADAPTIVE")].lower() for
op in opcode._specialized_instructions
if op.endswith("_ADAPTIVE")]
Reported by Pylint.
Line: 74
Column: 19
specialized_opcodes = [
op[:-len("_ADAPTIVE")].lower() for
op in opcode._specialized_instructions
if op.endswith("_ADAPTIVE")]
self.assertIn('load_attr', specialized_opcodes)
self.assertIn('binary_subscr', specialized_opcodes)
stats = _opcode.get_specialization_stats()
Reported by Pylint.
Line: 1
Column: 1
import dis
from test.support.import_helper import import_module
import unittest
import opcode
_opcode = import_module("_opcode")
from _opcode import stack_effect
Reported by Pylint.
Line: 7
Column: 1
import opcode
_opcode = import_module("_opcode")
from _opcode import stack_effect
class OpcodeTests(unittest.TestCase):
def test_stack_effect(self):
Reported by Pylint.
Line: 10
Column: 1
from _opcode import stack_effect
class OpcodeTests(unittest.TestCase):
def test_stack_effect(self):
self.assertEqual(stack_effect(dis.opmap['POP_TOP']), -1)
self.assertEqual(stack_effect(dis.opmap['DUP_TOP_TWO']), 2)
self.assertEqual(stack_effect(dis.opmap['BUILD_SLICE'], 0), -1)
Reported by Pylint.
Line: 12
Column: 5
class OpcodeTests(unittest.TestCase):
def test_stack_effect(self):
self.assertEqual(stack_effect(dis.opmap['POP_TOP']), -1)
self.assertEqual(stack_effect(dis.opmap['DUP_TOP_TWO']), 2)
self.assertEqual(stack_effect(dis.opmap['BUILD_SLICE'], 0), -1)
self.assertEqual(stack_effect(dis.opmap['BUILD_SLICE'], 1), -1)
self.assertEqual(stack_effect(dis.opmap['BUILD_SLICE'], 3), -2)
Reported by Pylint.
Line: 36
Column: 5
self.assertRaises(ValueError, stack_effect, code)
self.assertRaises(ValueError, stack_effect, code, 0)
def test_stack_effect_jump(self):
JUMP_IF_TRUE_OR_POP = dis.opmap['JUMP_IF_TRUE_OR_POP']
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=True), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=False), -1)
FOR_ITER = dis.opmap['FOR_ITER']
Reported by Pylint.
Line: 37
Column: 9
self.assertRaises(ValueError, stack_effect, code, 0)
def test_stack_effect_jump(self):
JUMP_IF_TRUE_OR_POP = dis.opmap['JUMP_IF_TRUE_OR_POP']
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=True), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=False), -1)
FOR_ITER = dis.opmap['FOR_ITER']
self.assertEqual(stack_effect(FOR_ITER, 0), 1)
Reported by Pylint.
Line: 41
Column: 9
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=True), 0)
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=False), -1)
FOR_ITER = dis.opmap['FOR_ITER']
self.assertEqual(stack_effect(FOR_ITER, 0), 1)
self.assertEqual(stack_effect(FOR_ITER, 0, jump=True), -1)
self.assertEqual(stack_effect(FOR_ITER, 0, jump=False), 1)
JUMP_FORWARD = dis.opmap['JUMP_FORWARD']
self.assertEqual(stack_effect(JUMP_FORWARD, 0), 0)
Reported by Pylint.
Line: 45
Column: 9
self.assertEqual(stack_effect(FOR_ITER, 0), 1)
self.assertEqual(stack_effect(FOR_ITER, 0, jump=True), -1)
self.assertEqual(stack_effect(FOR_ITER, 0, jump=False), 1)
JUMP_FORWARD = dis.opmap['JUMP_FORWARD']
self.assertEqual(stack_effect(JUMP_FORWARD, 0), 0)
self.assertEqual(stack_effect(JUMP_FORWARD, 0, jump=True), 0)
self.assertEqual(stack_effect(JUMP_FORWARD, 0, jump=False), 0)
# All defined opcodes
has_jump = dis.hasjabs + dis.hasjrel
Reported by Pylint.
Lib/test/mod_generics_cache.py
14 issues
Line: 9
Column: 5
if sys.version_info[:2] >= (3, 6):
exec(dedent("""
default_a: Optional['A'] = None
default_b: Optional['B'] = None
T = TypeVar('T')
Reported by Pylint.
Line: 9
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
if sys.version_info[:2] >= (3, 6):
exec(dedent("""
default_a: Optional['A'] = None
default_b: Optional['B'] = None
T = TypeVar('T')
Reported by Bandit.
Line: 33
Column: 5
default_a=Optional['A'],
default_b=Optional['B'],
)
default_a = None
default_b = None
T = TypeVar('T')
Reported by Pylint.
Line: 34
Column: 5
default_b=Optional['B'],
)
default_a = None
default_b = None
T = TypeVar('T')
class A(Generic[T]):
Reported by Pylint.
Line: 36
Column: 5
default_a = None
default_b = None
T = TypeVar('T')
class A(Generic[T]):
__annotations__ = dict(
some_b='B'
Reported by Pylint.
Line: 39
Column: 5
T = TypeVar('T')
class A(Generic[T]):
__annotations__ = dict(
some_b='B'
)
Reported by Pylint.
Line: 39
Column: 5
T = TypeVar('T')
class A(Generic[T]):
__annotations__ = dict(
some_b='B'
)
Reported by Pylint.
Line: 39
Column: 5
T = TypeVar('T')
class A(Generic[T]):
__annotations__ = dict(
some_b='B'
)
Reported by Pylint.
Line: 45
Column: 5
)
class B(Generic[T]):
class A(Generic[T]):
pass
__annotations__ = dict(
my_inner_a1='B.A',
Reported by Pylint.
Line: 45
Column: 5
)
class B(Generic[T]):
class A(Generic[T]):
pass
__annotations__ = dict(
my_inner_a1='B.A',
Reported by Pylint.
Lib/test/gdb_sample.py
14 issues
Line: 9
Column: 1
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
id(42)
foo(1, 2, 3)
Reported by Pylint.
Line: 1
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 3
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 3
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 3
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 3
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 3
Column: 1
# Sample script for use by test_gdb.py
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
Reported by Pylint.
Line: 6
Column: 1
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
id(42)
Reported by Pylint.
Line: 6
Column: 1
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
id(42)
Reported by Pylint.
Line: 6
Column: 1
def foo(a, b, c):
bar(a, b, c)
def bar(a, b, c):
baz(a, b, c)
def baz(*args):
id(42)
Reported by Pylint.
Lib/test/test_asyncio/test_context.py
14 issues
Line: 1
Column: 1
import asyncio
import decimal
import unittest
def tearDownModule():
asyncio.set_event_loop_policy(None)
Reported by Pylint.
Line: 6
Column: 1
import unittest
def tearDownModule():
asyncio.set_event_loop_policy(None)
@unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
class DecimalContextTest(unittest.TestCase):
Reported by Pylint.
Line: 6
Column: 1
import unittest
def tearDownModule():
asyncio.set_event_loop_policy(None)
@unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
class DecimalContextTest(unittest.TestCase):
Reported by Pylint.
Line: 11
Column: 1
@unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
Reported by Pylint.
Line: 13
Column: 5
@unittest.skipUnless(decimal.HAVE_CONTEXTVAR, "decimal is built with a thread-local context")
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
Reported by Pylint.
Line: 14
Column: 9
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
Reported by Pylint.
Line: 14
Column: 9
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
Reported by Pylint.
Line: 14
Column: 9
class DecimalContextTest(unittest.TestCase):
def test_asyncio_task_decimal_context(self):
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
Reported by Pylint.
Line: 17
Column: 17
async def fractions(t, precision, x, y):
with decimal.localcontext() as ctx:
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
return a, b
async def main():
Reported by Pylint.
Line: 19
Column: 17
ctx.prec = precision
a = decimal.Decimal(x) / decimal.Decimal(y)
await asyncio.sleep(t)
b = decimal.Decimal(x) / decimal.Decimal(y ** 2)
return a, b
async def main():
r1, r2 = await asyncio.gather(
fractions(0.1, 3, 1, 3), fractions(0.2, 6, 1, 3))
Reported by Pylint.