Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
drop python<=3.7 support #6459
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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') | ||
Uh oh!
There was an error while loading. Please reload this page.
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...