Mon, 28 Aug 2023 16:28:13 +0200
Made some modification in preparation for Python 3.12.
--- a/scripts/install.py Mon Aug 28 14:08:41 2023 +0200 +++ b/scripts/install.py Mon Aug 28 16:28:13 2023 +0200 @@ -1592,8 +1592,8 @@ print("\n") # perform dependency checks - if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 12, 0): - print("Sorry, you must have Python 3.8.0 or higher, but less 3.12.0.") + if sys.version_info < (3, 8, 0) or sys.version_info >= (3, 13, 0): + print("Sorry, you must have Python 3.8.0 or higher, but less 3.13.0.") print("Yours is {0}.".format(".".join(str(v) for v in sys.version_info[:3]))) exit(5)
--- a/src/eric7/MicroPython/Tools/uf2conv.py Mon Aug 28 14:08:41 2023 +0200 +++ b/src/eric7/MicroPython/Tools/uf2conv.py Mon Aug 28 16:28:13 2023 +0200 @@ -271,7 +271,7 @@ ] ) for line in to_str(r).split("\n"): - words = re.split("\s+", line) + words = re.split(r"\s+", line) if len(words) >= 3 and words[1] == "2" and words[2] == "FAT": drives.append(words[0]) else:
--- a/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/pyCheckSyntax.py Mon Aug 28 14:08:41 2023 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/pyCheckSyntax.py Mon Aug 28 16:28:13 2023 +0200 @@ -14,6 +14,7 @@ import queue import re import traceback +import warnings with contextlib.suppress(ImportError): from pyflakes.checker import Checker @@ -243,6 +244,8 @@ @rtype dict """ if codestring: + warnings.filterwarnings("error") + errorDict = {} try: # Check for VCS conflict markers for conflictMarkerRe in VcsConflictMarkerRegExpList: @@ -298,7 +301,7 @@ fn = detail.filename line = detail.lineno or 1 error = detail.msg - return [{"error": (fn, int(line), index, code.strip(), error)}] + errorDict = {"error": (fn, int(line), index, code.strip(), error)} except ValueError as detail: try: fn = detail.filename @@ -308,13 +311,19 @@ fn = filename line = 1 error = str(detail) - return [{"error": (fn, line, 0, "", error)}] + errorDict = {"error": (fn, line, 0, "", error)} except Exception as detail: with contextlib.suppress(AttributeError): fn = detail.filename line = detail.lineno error = detail.msg - return [{"error": (fn, line, 0, "", error)}] + errorDict = {"error": (fn, line, 0, "", error)} + finally: + warnings.resetwarnings() + + # return the syntax error or warning, if one was detected + if errorDict: + return [errorDict] # pyflakes if not checkFlakes: @@ -323,17 +332,17 @@ results = [] lines = codestring.splitlines() try: - warnings = Checker( + flakesWarnings = Checker( module, filename, builtins=additionalBuiltins, withDoctest=True ) - warnings.messages.sort(key=lambda a: a.lineno) - for warning in warnings.messages: + flakesWarnings.messages.sort(key=lambda a: a.lineno) + for flakesWarning in flakesWarnings.messages: if ignoreStarImportWarnings and isinstance( - warning, (ImportStarUsed, ImportStarUsage) + flakesWarning, (ImportStarUsed, ImportStarUsage) ): continue - _fn, lineno, col, message, msg_args = warning.getMessageData() + _fn, lineno, col, message, msg_args = flakesWarning.getMessageData() lineFlags = extractLineFlags(lines[lineno - 1].strip()) with contextlib.suppress(IndexError): lineFlags += extractLineFlags(lines[lineno].strip(), flagsLine=True)
--- a/src/eric7/QScintilla/TypingCompleters/CompleterYaml.py Mon Aug 28 14:08:41 2023 +0200 +++ b/src/eric7/QScintilla/TypingCompleters/CompleterYaml.py Mon Aug 28 16:28:13 2023 +0200 @@ -125,7 +125,7 @@ elif char == "\n" and self.__autoIndentation: txt = self.editor.text(line - 1) match = re.search( - "(?:\||\|-|\|\+|>|>-|>\+|-|:)(\s*)\r?\n", + r"(?:\||\|-|\|\+|>|>-|>\+|-|:)(\s*)\r?\n", # __IGNORE_WARNING_W605__ txt, )