mirror of
https://github.com/searxng/searxng
synced 2024-11-09 01:10:26 +00:00
542f7d0d7b
In the past, some files were tested with the standard profile, others with a profile in which most of the messages were switched off ... some files were not checked at all. - ``PYLINT_SEARXNG_DISABLE_OPTION`` has been abolished - the distinction ``# lint: pylint`` is no longer necessary - the pylint tasks have been reduced from three to two 1. ./searx/engines -> lint engines with additional builtins 2. ./searx ./searxng_extra ./tests -> lint all other python files Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
22 lines
534 B
Python
22 lines
534 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
if setproctitle is installed.
|
|
set Unix thread name with the Python thread name
|
|
"""
|
|
|
|
try:
|
|
import setproctitle
|
|
except ImportError:
|
|
pass
|
|
else:
|
|
import threading
|
|
|
|
old_thread_init = threading.Thread.__init__
|
|
|
|
def new_thread_init(self, *args, **kwargs):
|
|
# pylint: disable=protected-access, disable=c-extension-no-member
|
|
old_thread_init(self, *args, **kwargs)
|
|
setproctitle.setthreadtitle(self._name)
|
|
|
|
threading.Thread.__init__ = new_thread_init
|