Changed the minimum supported Python version to 3.6.0.

Fri, 18 Dec 2020 12:44:31 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 18 Dec 2020 12:44:31 +0100
changeset 7894
4370a8b30648
parent 7893
29d2c2e5b948
child 7895
554fdb07c856

Changed the minimum supported Python version to 3.6.0.

eric6/DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
eric6/DebugClients/Python/ModuleLoader.py file | annotate | diff | comparison | revisions
eric6/DebugClients/Python/MultiprocessingExtension.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py file | annotate | diff | comparison | revisions
eric6/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py file | annotate | diff | comparison | revisions
scripts/install-debugclients.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
--- a/eric6/DebugClients/Python/DebugBase.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/DebugClients/Python/DebugBase.py	Fri Dec 18 12:44:31 2020 +0100
@@ -105,7 +105,7 @@
         # Use it like this:
         # if hasattr(sys, 'breakpoint): sys.breakpoint()
         sys.breakpoint = self.set_trace
-        if sys.version_info[:2] >= (3, 7):
+        if sys.version_info >= (3, 7):
             sys.breakpointhook = self.set_trace
 
     def __eventPollTimer(self):
--- a/eric6/DebugClients/Python/ModuleLoader.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/DebugClients/Python/ModuleLoader.py	Fri Dec 18 12:44:31 2020 +0100
@@ -110,86 +110,49 @@
         self.__enableImportHooks = True
         return module
     
-    if sys.version_info >= (3, 4):
-        def find_spec(self, fullname, path, target=None):
-            """
-            Public method returning the module spec.
-            
-            @param fullname name of the module to be loaded
-            @type str
-            @param path path to resolve the module name
-            @type str
-            @param target module object to use for a more educated guess
-                about what spec to return
-            @type module
-            @return module spec object pointing to the module loader
-            @rtype ModuleSpec
-            """
-            if fullname in sys.modules or not self.__dbgClient.debugging:
-                return None
-            
-            if (
-                fullname in self.__modulesToPatch and
-                self.__enableImportHooks
-            ):
-                # Disable hook to be able to import original module
-                self.__enableImportHooks = False
-                return importlib.machinery.ModuleSpec(fullname, self)
-            
+    def find_spec(self, fullname, path, target=None):
+        """
+        Public method returning the module spec.
+        
+        @param fullname name of the module to be loaded
+        @type str
+        @param path path to resolve the module name
+        @type str
+        @param target module object to use for a more educated guess
+            about what spec to return
+        @type module
+        @return module spec object pointing to the module loader
+        @rtype ModuleSpec
+        """
+        if fullname in sys.modules or not self.__dbgClient.debugging:
             return None
         
-        def create_module(self, spec):
-            """
-            Public method to create a module based on the passed in spec.
-            
-            @param spec module spec object for loading the module
-            @type ModuleSpec
-            @return created and patched module
-            @rtype module
-            """
-            return self.__loadModule(spec.name)
+        if (
+            fullname in self.__modulesToPatch and
+            self.__enableImportHooks
+        ):
+            # Disable hook to be able to import original module
+            self.__enableImportHooks = False
+            return importlib.machinery.ModuleSpec(fullname, self)
         
-        def exec_module(self, module):
-            """
-            Public method to execute the created module.
-            
-            @param module module to be executed
-            @type module
-            """
-            pass
+        return None
     
-    else:
-        def find_module(self, fullname, path=None):
-            """
-            Public method returning the module loader.
-            
-            @param fullname name of the module to be loaded
-            @type str
-            @param path path to resolve the module name
-            @type str
-            @return module loader object
-            @rtype object
-            """
-            if fullname in sys.modules or not self.__dbgClient.debugging:
-                return None
-            
-            if (
-                fullname in self.__modulesToPatch and
-                self.__enableImportHooks
-            ):
-                # Disable hook to be able to import original module
-                self.__enableImportHooks = False
-                return self
-            
-            return None
+    def create_module(self, spec):
+        """
+        Public method to create a module based on the passed in spec.
         
-        def load_module(self, fullname):
-            """
-            Public method to load a module.
-            
-            @param fullname name of the module to be loaded
-            @type str
-            @return reference to the loaded module
-            @rtype module
-            """
-            return self.__loadModule(fullname)
+        @param spec module spec object for loading the module
+        @type ModuleSpec
+        @return created and patched module
+        @rtype module
+        """
+        return self.__loadModule(spec.name)
+    
+    def exec_module(self, module):
+        """
+        Public method to execute the created module.
+        
+        @param module module to be executed
+        @type module
+        """
+        pass
--- a/eric6/DebugClients/Python/MultiprocessingExtension.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/DebugClients/Python/MultiprocessingExtension.py	Fri Dec 18 12:44:31 2020 +0100
@@ -29,10 +29,7 @@
     
     _debugClient = debugClient
     
-    if sys.version_info >= (3, 4):
-        _originalProcess = module.process.BaseProcess
-    else:
-        _originalProcess = module.Process
+    _originalProcess = module.process.BaseProcess
     _originalBootstrap = _originalProcess._bootstrap
     
     # TODO: implement a process tracer
@@ -82,7 +79,4 @@
             
             return exitcode
     
-    if sys.version_info >= (3, 4):
-        _originalProcess._bootstrap = ProcessWrapper._bootstrap
-    else:
-        module.Process = ProcessWrapper
+    _originalProcess._bootstrap = ProcessWrapper._bootstrap
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py	Fri Dec 18 12:44:31 2020 +0100
@@ -439,18 +439,12 @@
         arguments = []
         arguments.extend([arg.arg for arg in node.args.args])
         if node.args.vararg is not None:
-            if sys.version_info < (3, 4, 0):
-                arguments.append(node.args.vararg)
-            else:
-                arguments.append(node.args.vararg.arg)
+            arguments.append(node.args.vararg.arg)
         
         kwarguments = []
         kwarguments.extend([arg.arg for arg in node.args.kwonlyargs])
         if node.args.kwarg is not None:
-            if sys.version_info < (3, 4, 0):
-                kwarguments.append(node.args.kwarg)
-            else:
-                kwarguments.append(node.args.kwarg.arg)
+            kwarguments.append(node.args.kwarg.arg)
         return arguments, kwarguments
     
     ##################################################################
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py	Fri Dec 18 12:44:31 2020 +0100
@@ -558,18 +558,14 @@
                 numArgs = len(call.args)
                 if strArgs:
                     numArgs -= 1
-                if sys.version_info < (3, 5):
-                    hasKwArgs = bool(call.kwargs)
-                    hasStarArgs = bool(call.starargs)
-                else:
-                    hasKwArgs = any(kw.arg is None for kw in call.keywords)
-                    hasStarArgs = sum(1 for arg in call.args
-                                      if isinstance(arg, ast.Starred))
-                    
-                    if hasKwArgs:
-                        keywords.discard(None)
-                    if hasStarArgs:
-                        numArgs -= 1
+                hasKwArgs = any(kw.arg is None for kw in call.keywords)
+                hasStarArgs = sum(1 for arg in call.args
+                                  if isinstance(arg, ast.Starred))
+                
+                if hasKwArgs:
+                    keywords.discard(None)
+                if hasStarArgs:
+                    numArgs -= 1
                 
                 # if starargs or kwargs is not None, it can't count the
                 # parameters but at least check if the args are used
@@ -1294,13 +1290,12 @@
         @param node reference to the node to be processed
         @type ast.JoinedStr
         """
-        if sys.version_info >= (3, 6):
-            if self.__withinLoggingStatement():
-                if any(isinstance(i, ast.FormattedValue) for i in node.values):
-                    if self.__withinLoggingArgument():
-                        self.violations.append((node, "M654"))
-                        
-                        super(LoggingVisitor, self).generic_visit(node)
+        if self.__withinLoggingStatement():
+            if any(isinstance(i, ast.FormattedValue) for i in node.values):
+                if self.__withinLoggingArgument():
+                    self.violations.append((node, "M654"))
+                    
+                    super(LoggingVisitor, self).generic_visit(node)
 
 
 class BugBearVisitor(ast.NodeVisitor):
@@ -1504,12 +1499,11 @@
         @param node reference to the node to be processed
         @type ast.JoinedStr
         """
-        if sys.version_info >= (3, 6):
-            for value in node.values:
-                if isinstance(value, ast.FormattedValue):
-                    return
-            
-            self.violations.append((node, "M508"))
+        for value in node.values:
+            if isinstance(value, ast.FormattedValue):
+                return
+        
+        self.violations.append((node, "M508"))
     
     def __checkForM502(self, node):
         """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py	Fri Dec 18 12:44:31 2020 +0100
@@ -11,7 +11,6 @@
 import ast
 import re
 import os
-import sys
 
 try:
     ast.AsyncFunctionDef    # __IGNORE_EXCEPTION__
@@ -324,19 +323,13 @@
             (integer, integer, string)
         """
         if node.args.kwarg is not None:
-            if sys.version_info >= (3, 4):
-                kwarg = node.args.kwarg.arg
-            else:
-                kwarg = node.args.kwarg
+            kwarg = node.args.kwarg.arg
             if not self.LowercaseRegex.match(kwarg):
                 yield self.__error(node, "N803")
                 return
         
         if node.args.vararg is not None:
-            if sys.version_info >= (3, 4):
-                vararg = node.args.vararg.arg
-            else:
-                vararg = node.args.vararg
+            vararg = node.args.vararg.arg
             if not self.LowercaseRegex.match(vararg):
                 yield self.__error(node, "N803")
                 return
--- a/scripts/install-debugclients.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/scripts/install-debugclients.py	Fri Dec 18 12:44:31 2020 +0100
@@ -240,8 +240,8 @@
     global progName, modDir, doCleanup, doCompile, distDir
     global sourceDir
     
-    if sys.version_info < (3, 5, 0) or sys.version_info >= (4, 0, 0):
-        print('Sorry, the eric6 debugger requires Python 3.5 or better'
+    if sys.version_info < (3, 6, 0) or sys.version_info >= (4, 0, 0):
+        print('Sorry, the eric6 debugger requires Python 3.6 or better'
               ' for running.')
         exit(5)
     
--- a/scripts/install.py	Fri Dec 18 12:24:33 2020 +0100
+++ b/scripts/install.py	Fri Dec 18 12:44:31 2020 +0100
@@ -1431,8 +1431,8 @@
     
     # perform dependency checks
     print("Python Version: {0:d}.{1:d}.{2:d}".format(*sys.version_info[:3]))
-    if sys.version_info < (3, 5, 0):
-        print('Sorry, you must have Python 3.5.0 or higher.')
+    if sys.version_info < (3, 6, 0):
+        print('Sorry, you must have Python 3.6.0 or higher.')
         exit(5)
     
     try:
@@ -1874,8 +1874,8 @@
     global installApis, doCleanDesktopLinks, yes2All, installCwd
     global ignorePyqt5Tools
     
-    if sys.version_info < (3, 5, 0) or sys.version_info > (3, 99, 99):
-        print('Sorry, eric6 requires at least Python 3.5 for running.')
+    if sys.version_info < (3, 6, 0) or sys.version_info > (3, 99, 99):
+        print('Sorry, eric6 requires at least Python 3.6 for running.')
         exit(5)
     
     progName = os.path.basename(argv[0])

eric ide

mercurial