Skip to content

Commit ee58984

Browse files
committed
Merge / style fixes.
1 parent 7dac5be commit ee58984

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

mypy/plugin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def named_generic_type(self, name: str, args: List[Type]) -> Instance:
111111
# arguments of the documented function; otherwise, an error will be raised.
112112
DocstringParserContext = NamedTuple(
113113
'DocstringParserContext', [
114-
('docstring', str), # The docstring to be parsed
115-
('line', int), # The line number where the docstring begins
116-
('errors', 'Errors') # Errors object for reporting errors, warnings, and info
114+
('docstring', str), # The docstring to be parsed
115+
('line', int), # The line number where the docstring begins
116+
('errors', 'Errors') # Errors object for reporting errors, warnings, and info
117117
])
118118

119119
TypeMap = Dict[
120-
str, # Argument name, or 'return' for return type.
121-
Type # Corresponding type extracted from docstring
122-
]
120+
str, # Argument name, or 'return' for return type.
121+
Type # Corresponding type extracted from docstring
122+
]
123123

124124

125125
class Plugin:

mypy/stubgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def generate_stub(path: str, output_dir: str, _all_: Optional[List[str]] = None,
195195
source = f.read()
196196
options = MypyOptions()
197197
options.python_version = pyversion
198-
plugin = Plugin(pyversion)
198+
plugin = Plugin(options)
199199
try:
200200
ast = mypy.parse.parse(source, fnam=path, errors=None, options=options, plugin=plugin)
201201
except mypy.errors.CompileError as e:

mypy/test/testparse.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_parser(testcase: DataDrivenTestCase) -> None:
4545
fnam='main',
4646
errors=None,
4747
options=options,
48-
plugin=Plugin(options.python_version))
48+
plugin=Plugin(options))
4949
a = str(n).split('\n')
5050
except CompileError as e:
5151
a = e.messages
@@ -70,8 +70,9 @@ def cases(self) -> List[DataDrivenTestCase]:
7070
def test_parse_error(testcase: DataDrivenTestCase) -> None:
7171
try:
7272
# Compile temporary file. The test file contains non-ASCII characters.
73-
parse(bytes('\n'.join(testcase.input), 'utf-8'), INPUT_FILE_NAME, None, Options(),
74-
Plugin())
73+
options = Options()
74+
parse(bytes('\n'.join(testcase.input), 'utf-8'), INPUT_FILE_NAME, None, options,
75+
Plugin(options))
7576
raise AssertionFailure('No errors reported')
7677
except CompileError as e:
7778
# Verify that there was a compile error and that the error messages

0 commit comments

Comments
 (0)