From 0b8846375b938090e056b8219c6679d53bed3ecd Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Mon, 17 May 2021 21:59:15 +0530 Subject: [PATCH 1/4] fixed warnings --- .idea/.gitignore | 3 +++ .idea/cheroot.iml | 15 +++++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 12 ++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ cheroot/workers/threadpool.py | 5 ++++- 8 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/cheroot.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..26d33521af --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/cheroot.iml b/.idea/cheroot.iml new file mode 100644 index 0000000000..1dc6d48e03 --- /dev/null +++ b/.idea/cheroot.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..d98bd29d6c --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000000..105ce2da2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000..a6fa933e01 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..2a69a531af --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index 915934ccea..7ad74d55e3 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -15,6 +15,7 @@ import socket import warnings + from six.moves import queue from jaraco.functools import pass_none @@ -258,11 +259,13 @@ def shrink(self, amount): def stop(self, timeout=5): """Terminate all worker threads. + Args: timeout (int): time to wait for threads to stop gracefully """ # for compatability, negative timeouts are treated like None # TODO: treat negative timeouts like already expired timeouts + endtime=float(0) if timeout is not None and timeout < 0: timeout = None warnings.warning( @@ -320,7 +323,7 @@ def _clear_threads(self): return ( thread for thread in threads - if thread is not threading.currentThread() + if thread is not threading.current_thread() ) @property From 12fa2cc5dae46394623dd85d97293fd59d982242 Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Mon, 17 May 2021 22:42:05 +0530 Subject: [PATCH 2/4] endtime resolved --- cheroot/workers/threadpool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index 7ad74d55e3..72b57709c4 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -265,7 +265,7 @@ def stop(self, timeout=5): """ # for compatability, negative timeouts are treated like None # TODO: treat negative timeouts like already expired timeouts - endtime=float(0) + if timeout is not None and timeout < 0: timeout = None warnings.warning( From 4c35a88b81f09404592e4c1f102b68dd9030483a Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Tue, 18 May 2021 12:09:17 +0530 Subject: [PATCH 3/4] added requested changes --- .idea/.gitignore | 3 --- .idea/cheroot.iml | 15 --------------- .idea/inspectionProfiles/Project_Default.xml | 12 ------------ .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ cheroot/workers/threadpool.py | 2 -- 8 files changed, 56 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/cheroot.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d33521af..0000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/cheroot.iml b/.idea/cheroot.iml deleted file mode 100644 index 1dc6d48e03..0000000000 --- a/.idea/cheroot.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index d98bd29d6c..0000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da2d..0000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index a6fa933e01..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 2a69a531af..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index 72b57709c4..e953fec775 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -259,13 +259,11 @@ def shrink(self, amount): def stop(self, timeout=5): """Terminate all worker threads. - Args: timeout (int): time to wait for threads to stop gracefully """ # for compatability, negative timeouts are treated like None # TODO: treat negative timeouts like already expired timeouts - if timeout is not None and timeout < 0: timeout = None warnings.warning( From 0e14a22930a202a8f357a13e38daf15eaf35de73 Mon Sep 17 00:00:00 2001 From: Soham Banerjee Date: Tue, 18 May 2021 12:12:19 +0530 Subject: [PATCH 4/4] restored formatting --- cheroot/workers/threadpool.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index e953fec775..57e6588dd6 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -15,7 +15,6 @@ import socket import warnings - from six.moves import queue from jaraco.functools import pass_none