瀏覽代碼

Support 3.8

jrobinAV 1 年之前
父節點
當前提交
e5f1f4f66e
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      taipy/core/_orchestrator/_dispatcher/_standalone_job_dispatcher.py

+ 5 - 2
taipy/core/_orchestrator/_dispatcher/_standalone_job_dispatcher.py

@@ -8,7 +8,7 @@
 # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 # specific language governing permissions and limitations under the License.
-
+import sys
 from concurrent.futures import Executor, ProcessPoolExecutor
 from functools import partial
 from typing import Callable, Optional
@@ -55,4 +55,7 @@ class _StandaloneJobDispatcher(_JobDispatcher):
 
     def stop(self):
         super().stop()
-        self._executor.shutdown(wait=True, cancel_futures=True)
+        if sys.version_info >= (3, 9):
+            self._executor.shutdown(wait=True, cancel_futures=False)
+        else:
+            self._executor.shutdown(wait=True)  # cancel_futures is not available in Python 3.8