src/eric7/Utilities/__init__.py

branch
eric7
changeset 10069
435cc5875135
parent 10060
b946699e9e79
child 10079
0222a480e93d
child 10331
c1a2ff7e3575
diff -r 7febcdccb2a1 -r 435cc5875135 src/eric7/Utilities/__init__.py
--- a/src/eric7/Utilities/__init__.py	Thu May 25 11:12:05 2023 +0200
+++ b/src/eric7/Utilities/__init__.py	Thu May 25 19:51:47 2023 +0200
@@ -38,7 +38,9 @@
 from eric7.UI.Info import Program, Version
 
 
-def __showwarning(message, category, filename, lineno, file=None, line=""):
+def __showwarning(
+    message, category, filename, lineno, file=None, line=""  # noqa: U100
+):
     """
     Module function to raise a SyntaxError for a SyntaxWarning.
 
@@ -625,13 +627,13 @@
     """
     if eol == "\r\n":
         regexp = re.compile(r"""(\r(?!\n)|(?<!\r)\n)""")
-        return regexp.sub(lambda m, eol="\r\n": eol, text)
+        return regexp.sub("\r\n", text)
     elif eol == "\n":
         regexp = re.compile(r"""(\r\n|\r)""")
-        return regexp.sub(lambda m, eol="\n": eol, text)
+        return regexp.sub("\n", text)
     elif eol == "\r":
         regexp = re.compile(r"""(\r\n|\n)""")
-        return regexp.sub(lambda m, eol="\r": eol, text)
+        return regexp.sub("\r", text)
     else:
         return text
 

eric ide

mercurial