Skip to content

Commit 6baadee

Browse files
committed
Revert "not set as global if apply context didn't work"
This reverts commit 477a2f7.
1 parent f1470fc commit 6baadee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ansys/dpf/core/server_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,11 @@ def __init__(self,
665665
self.live = True
666666
self._create_shutdown_funcs()
667667
self._check_first_call(num_connection_tryouts)
668+
self.set_as_global(as_global=as_global)
668669
try:
669670
self.apply_context(context)
670671
except errors.DpfVersionNotSupported:
671672
pass
672-
self.set_as_global(as_global=as_global)
673673

674674
def _check_first_call(self, num_connection_tryouts):
675675
for i in range(num_connection_tryouts):
@@ -832,6 +832,7 @@ def __init__(self,
832832
f"DPF directory not found at {os.path.dirname(path)}"
833833
f"Unable to locate the following file: {path}")
834834
raise e
835+
self.set_as_global(as_global=as_global)
835836
try:
836837
self.apply_context(context)
837838
except errors.DpfVersionNotSupported:
@@ -840,7 +841,6 @@ def __init__(self,
840841
)
841842
self._context = server_context.AvailableServerContexts.premium
842843
pass
843-
self.set_as_global(as_global=as_global)
844844

845845
@property
846846
def version(self):
@@ -980,11 +980,11 @@ def __init__(
980980
self._create_shutdown_funcs()
981981

982982
check_ansys_grpc_dpf_version(self, timeout)
983+
self.set_as_global(as_global=as_global)
983984
try:
984985
self.apply_context(context)
985986
except errors.DpfVersionNotSupported:
986987
pass
987-
self.set_as_global(as_global=as_global)
988988

989989
def _create_shutdown_funcs(self):
990990
self._core_api = data_processing_grpcapi.DataProcessingGRPCAPI

0 commit comments

Comments
 (0)