Fixed bug in reporting errors for None used as context manager -- was using the wrong parse node for the error.

This commit is contained in:
Eric Traut 2019-05-18 01:03:20 -07:00
parent ebef341997
commit ba3d1871c1

View File

@ -680,7 +680,7 @@ export class TypeAnalyzer extends ParseTreeWalker {
this._addDiagnostic(
this._fileInfo.configOptions.reportOptionalContextManager,
`Object of type 'None' cannot be used with 'with'`,
node);
item.expression);
exprType = TypeUtils.removeNoneFromUnion(exprType);
}