PEP 257: Use sys.maxsize instead of sys.maxint (#2629)

In python3, sys.maxint changed to sys.maxsize.
This commit is contained in:
Pankwings 2022-06-07 01:02:50 +05:30 committed by GitHub
parent bd3afcea5b
commit eaa22dbacb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -224,14 +224,14 @@ of the algorithm::
# and split into a list of lines:
lines = docstring.expandtabs().splitlines()
# Determine minimum indentation (first line doesn't count):
indent = sys.maxint
indent = sys.maxsize
for line in lines[1:]:
stripped = line.lstrip()
if stripped:
indent = min(indent, len(line) - len(stripped))
# Remove indentation (first line is special):
trimmed = [lines[0].strip()]
if indent < sys.maxint:
if indent < sys.maxsize:
for line in lines[1:]:
trimmed.append(line[indent:].rstrip())
# Strip off trailing and leading blank lines: