gh-133158: Adjust c-analyzer max_sizes for typeobject.c (GH-133159)

This also improves the error message for when a file is too large.
This commit is contained in:
Sergey Miryanov 2025-09-02 06:34:22 -07:00 committed by GitHub
parent 0a0cbd43a7
commit 33f89106d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 5 deletions

View file

@ -123,10 +123,16 @@ def resolve(self, kind, data, name, parent=None):
def done(self):
self._set_ready()
def too_much_text(self, maxtext):
return maxtext and len(self.text) > maxtext
def too_many_lines(self, maxlines):
return maxlines and self.end - self.start > maxlines
def too_much(self, maxtext, maxlines):
if maxtext and len(self.text) > maxtext:
if self.too_much_text(maxtext):
pass
elif maxlines and self.end - self.start > maxlines:
elif self.too_many_lines(maxlines):
pass
else:
return False