-
Notifications
You must be signed in to change notification settings - Fork 1.5k
drop python<=3.7 support #6459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kloczek
wants to merge
2
commits into
danmar:main
Choose a base branch
from
kloczek:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
drop python<=3.7 support #6459
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ | |
| 'extra': ''} | ||
| sys.stdout.write(json.dumps(msg) + '\n') | ||
| else: | ||
| sys.stderr.write('%s [%s]\n' % (message, error_id)) | ||
| sys.stderr.write('{} [{}]\n'.format(message, error_id)) | ||
| sys.exit(1) | ||
|
|
||
| from xml.etree import ElementTree | ||
|
|
@@ -91,7 +91,7 @@ def __repr__(self): | |
| attrs = ["str", "file", "linenr"] | ||
| return "{}({})".format( | ||
| "Directive", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| class MacroUsage: | ||
|
|
@@ -127,7 +127,7 @@ def __repr__(self): | |
| attrs = ["name", "file", "linenr", "column", "usefile", "useline", "usecolumn", "isKnownValue"] | ||
| return "{}({})".format( | ||
| "MacroUsage", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -156,7 +156,7 @@ def __repr__(self): | |
| attrs = ["file", "linenr", "column", "E", "result"] | ||
| return "{}({})".format( | ||
| "PreprocessorIfCondition", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| class ValueType: | ||
|
|
@@ -202,7 +202,7 @@ def __repr__(self): | |
| "constness", "pointer"] | ||
| return "{}({})".format( | ||
| "ValueType", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -445,7 +445,7 @@ def __repr__(self): | |
| "linenr", "column"] | ||
| return "{}({})".format( | ||
| "Token", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| def setId(self, IdMap): | ||
|
|
@@ -602,7 +602,7 @@ def __repr__(self): | |
| "nestedInId", "nestedIn", "type", "definedType", "isExecutable", "functions"] | ||
| return "{}({})".format( | ||
| "Scope", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| def setId(self, IdMap): | ||
|
|
@@ -682,7 +682,7 @@ def __repr__(self): | |
| "isAttributeNoreturn", "overriddenFunction", "nestedIn", "argumentId"] | ||
| return "{}({})".format( | ||
| "Function", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| def setId(self, IdMap): | ||
|
|
@@ -777,7 +777,7 @@ def __repr__(self): | |
| "isReference", "isStatic", "isVolatile", "constness"] | ||
| return "{}({})".format( | ||
| "Variable", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| def setId(self, IdMap): | ||
|
|
@@ -905,7 +905,7 @@ def __repr__(self): | |
| "bufferSize", "containerSize", "condition", "valueKind"] | ||
| return "{}({})".format( | ||
| "Value", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -932,7 +932,7 @@ def __repr__(self): | |
| attrs = ["Id", "values"] | ||
| return "{}({})".format( | ||
| "ValueFlow", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -972,7 +972,7 @@ def __repr__(self): | |
| attrs = ["errorId", "fileName", "lineNumber", "symbolName", "lineBegin", "lineEnd","suppressionType"] | ||
| return "{}({})".format( | ||
| "Suppression", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
| def isMatch(self, file, line, message, errorId): | ||
|
|
@@ -1138,7 +1138,7 @@ def __repr__(self): | |
| "long_bit", "long_long_bit", "pointer_bit"] | ||
| return "{}({})".format( | ||
| "Platform", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -1170,7 +1170,7 @@ def __repr__(self): | |
| attrs = ["c", "cpp", "posix"] | ||
| return "{}({})".format( | ||
| "Standards", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -1405,7 +1405,7 @@ def __repr__(self): | |
| attrs = ["configurations", "platform"] | ||
| return "{}({})".format( | ||
| "CppcheckData", | ||
| ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) | ||
| ", ".join(f"{a}={repr(getattr(self, a))}" for a in attrs) | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -1506,7 +1506,7 @@ def get_files(args): | |
| """Return dump_files, ctu_info_files""" | ||
| all_files = args.dumpfile | ||
| if args.file_list: | ||
| with open(args.file_list, 'rt') as f: | ||
| with open(args.file_list) as f: | ||
| for line in f.readlines(): | ||
| all_files.append(line.rstrip()) | ||
| dump_files = [] | ||
|
|
@@ -1671,19 +1671,19 @@ def reportError(location, severity, message, addon, errorId, extra='', columnOve | |
| 'extra': extra} | ||
| sys.stdout.write(json.dumps(msg) + '\n') | ||
| else: | ||
| if is_suppressed(location, message, '%s-%s' % (addon, errorId)): | ||
| if is_suppressed(location, message, '{}-{}'.format(addon, errorId)): | ||
| return | ||
| loc = '[%s:%i]' % (location.file, location.linenr) | ||
| if len(extra) > 0: | ||
| message += ' (' + extra + ')' | ||
| sys.stderr.write('%s (%s) %s [%s-%s]\n' % (loc, severity, message, addon, errorId)) | ||
| sys.stderr.write('{} ({}) {} [{}-{}]\n'.format(loc, severity, message, addon, errorId)) | ||
| global EXIT_CODE | ||
| EXIT_CODE = 1 | ||
|
|
||
| def reportSummary(dumpfile, summary_type, summary_data): | ||
| # dumpfile ends with ".dump" | ||
| ctu_info_file = dumpfile[:-4] + "ctu-info" | ||
| with open(ctu_info_file, 'at') as f: | ||
| with open(ctu_info_file, 'a') as f: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. "text" vs "binary" might be important in some cases so that should be explicitly stated. |
||
| msg = {'summary': summary_type, 'data': summary_data} | ||
| f.write(json.dumps(msg) + '\n') | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like this at all. This should be explicitly specified for various reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering adding
pyupgradeto the CI but theopen()thing still irked me.And then I came across asottile/pyupgrade#714.
Given the attitude of the author I will refrain from integrating that tool and would also be reluctant to accept changes which are based on it. Such behavior should be not supported...