Skip to content

Commit

Permalink
Revert "Fix bug 843531 - DPF: Access violation when DataSource is inc…
Browse files Browse the repository at this point in the history
…orrectly constructed (#1139)"

This reverts commit 3c149bd.
  • Loading branch information
anslpa authored Sep 11, 2023
1 parent 3c149bd commit 809ce67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 2 additions & 6 deletions src/ansys/dpf/core/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
)

from ansys.dpf.core.check_version import version_requires
from ansys.grpc.dpf import data_sources_pb2
from ansys.dpf.core import errors


class DataSources:
"""Contains files with analysis results.
Expand Down Expand Up @@ -78,12 +77,9 @@ def __init__(self, result_path=None, data_sources=None, server=None):
self._internal_obj = core_api.data_processing_duplicate_object_reference(
data_sources
)
elif isinstance(data_sources, data_sources_pb2.DataSources) or isinstance(data_sources, int):
else:
# It should be a message (usually from a call to operator_getoutput_data_sources)
self._internal_obj = data_sources
else:
self._internal_obj = None
raise errors.DpfValueError("Data source must be gRPC data sources message type")
else:
if self._server.has_client():
self._internal_obj = self._api.data_sources_new_on_client(self._server.client)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def test_print_data_sources(allkindofcomplexity, server_type):


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

Expand Down

0 comments on commit 809ce67

Please sign in to comment.