@zzzen/pyright-internal 1.2.0-dev.20241124 → 1.2.0-dev.20241201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -862,7 +862,9 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
862
862
  }
863
863
  unescapedResult.unescapeErrors.forEach((error) => {
864
864
  if (error.errorType === 0 /* UnescapeErrorType.InvalidEscapeSequence */) {
865
- this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportInvalidStringEscapeSequence, localize_1.LocMessage.stringUnsupportedEscape(), { start: start + error.offset, length: error.length });
865
+ this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportInvalidStringEscapeSequence, node.d.strings.some((string) => (string.d.token.flags & 32 /* StringTokenFlags.Bytes */) !== 0)
866
+ ? localize_1.LocMessage.bytesUnsupportedEscape()
867
+ : localize_1.LocMessage.stringUnsupportedEscape(), { start: start + error.offset, length: error.length });
866
868
  }
867
869
  });
868
870
  // Prior to Python 3.12, it was not allowed to include a slash in an f-string.