eric7/DebugClients/Python/coverage/control.py

branch
eric7-maintenance
changeset 9111
4ac66b6c33a4
parent 8991
2fc945191992
diff -r 2b9bd8f97576 -r 4ac66b6c33a4 eric7/DebugClients/Python/coverage/control.py
--- a/eric7/DebugClients/Python/coverage/control.py	Mon May 02 15:53:05 2022 +0200
+++ b/eric7/DebugClients/Python/coverage/control.py	Wed Jun 01 13:48:49 2022 +0200
@@ -250,7 +250,7 @@
             source=source, source_pkgs=source_pkgs, run_omit=omit, run_include=include, debug=debug,
             report_omit=omit, report_include=include,
             concurrency=concurrency, context=context,
-            )
+        )
 
         # If we have sub-process measurement happening automatically, then we
         # want any explicit creation of a Coverage object to mean, this process
@@ -489,7 +489,7 @@
             branch=self.config.branch,
             warn=self._warn,
             concurrency=concurrency,
-            )
+        )
 
         suffix = self._data_suffix_specified
         if suffix:
@@ -515,10 +515,10 @@
                     ", ".join(
                         plugin._coverage_plugin_name
                             for plugin in self._plugins.file_tracers
-                        ),
+                    ),
                     self._collector.tracer_name(),
-                    )
                 )
+            )
             for plugin in self._plugins.file_tracers:
                 plugin._coverage_enabled = False
 
@@ -536,12 +536,13 @@
 
         # Register our clean-up handlers.
         atexit.register(self._atexit)
-        is_main = (threading.current_thread() == threading.main_thread())
-        if is_main and not env.WINDOWS:
-            # The Python docs seem to imply that SIGTERM works uniformly even
-            # on Windows, but that's not my experience, and this agrees:
-            # https://stackoverflow.com/questions/35772001/x/35792192#35792192
-            self._old_sigterm = signal.signal(signal.SIGTERM, self._on_sigterm)
+        if self.config.sigterm:
+            is_main = (threading.current_thread() == threading.main_thread())
+            if is_main and not env.WINDOWS:
+                # The Python docs seem to imply that SIGTERM works uniformly even
+                # on Windows, but that's not my experience, and this agrees:
+                # https://stackoverflow.com/questions/35772001/x/35792192#35792192
+                self._old_sigterm = signal.signal(signal.SIGTERM, self._on_sigterm)
 
     def _init_data(self, suffix):
         """Create a data file if we don't have one yet."""
@@ -835,7 +836,7 @@
             sorted(analysis.excluded),
             sorted(analysis.missing),
             analysis.missing_formatted(),
-            )
+        )
 
     def _analyze(self, it):
         """Analyze a single morf or code unit.
@@ -1146,7 +1147,7 @@
                 )
             )),
             ('command_line', " ".join(getattr(sys, 'argv', ['-none-']))),
-            ]
+        ]
 
         if self._inorout:
             info.extend(self._inorout.sys_info())

eric ide

mercurial