Skip to content

Commit d03c968

Browse files
MichaelNaleanslpa
andauthored
Revert "Fix bug 843531 - DPF: Access violation when DataSource is incorrectly constructed (#1139)" (#1145)
This reverts commit 3c149bd. Co-authored-by: anslpa <[email protected]>
1 parent 3c149bd commit d03c968

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/ansys/dpf/core/data_sources.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
)
1919

2020
from ansys.dpf.core.check_version import version_requires
21-
from ansys.grpc.dpf import data_sources_pb2
22-
from ansys.dpf.core import errors
21+
2322

2423
class DataSources:
2524
"""Contains files with analysis results.
@@ -78,12 +77,9 @@ def __init__(self, result_path=None, data_sources=None, server=None):
7877
self._internal_obj = core_api.data_processing_duplicate_object_reference(
7978
data_sources
8079
)
81-
elif isinstance(data_sources, data_sources_pb2.DataSources) or isinstance(data_sources, int):
80+
else:
8281
# It should be a message (usually from a call to operator_getoutput_data_sources)
8382
self._internal_obj = data_sources
84-
else:
85-
self._internal_obj = None
86-
raise errors.DpfValueError("Data source must be gRPC data sources message type")
8783
else:
8884
if self._server.has_client():
8985
self._internal_obj = self._api.data_sources_new_on_client(self._server.client)

tests/test_datasources.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ def test_print_data_sources(allkindofcomplexity, server_type):
6161

6262

6363
def test_data_sources_from_data_sources(allkindofcomplexity, server_type):
64-
with pytest.raises(ValueError) as e:
65-
data_sources_false = dpf.core.DataSources(data_sources="Wrong Input", server=server_type)
66-
assert "Data source must be gRPC data sources message type" in e
6764
data_sources = dpf.core.DataSources(server=server_type)
6865
data_sources2 = dpf.core.DataSources(data_sources=data_sources, server=server_type)
6966

0 commit comments

Comments
 (0)