diff --git a/ansys/dpf/core/core.py b/ansys/dpf/core/core.py index 47c4e4d79a..81dda33228 100644 --- a/ansys/dpf/core/core.py +++ b/ansys/dpf/core/core.py @@ -25,6 +25,12 @@ object_handler ) +try: + from grpc import _channel # noqa: F401 + # weirdly necessary to delete LegacyGrpcError +except ImportError: + pass + LOG = logging.getLogger(__name__) LOG.setLevel("DEBUG") diff --git a/ansys/dpf/core/model.py b/ansys/dpf/core/model.py index 70a5e6eb7a..c77e49ec26 100644 --- a/ansys/dpf/core/model.py +++ b/ansys/dpf/core/model.py @@ -412,9 +412,9 @@ def _load_result_info(self): op.inputs.connect(self._stream_provider.outputs) try: result_info = op.get_output(0, types.result_info) - except _InactiveRpcError as e: + except Exception as e: # give the user a more helpful error - if "results file is not defined in the Data sources" in e.details(): + if "results file is not defined in the Data sources" in e.args(): raise RuntimeError("Unable to open result file") from None else: raise e diff --git a/ansys/dpf/core/server.py b/ansys/dpf/core/server.py index e45b91ed32..53139daf64 100644 --- a/ansys/dpf/core/server.py +++ b/ansys/dpf/core/server.py @@ -127,7 +127,7 @@ def start_local_server( load_operators=True, use_docker_by_default=True, docker_config=RUNNING_DOCKER, - timeout=5., + timeout=20., config=None, use_pypim_by_default=True ):