Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pybind11/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ inline bool mooseDeleteObj(const ObjId& oid)

inline bool mooseDeleteStr(const string& path)
{
auto o = ObjId(path);
if(o.bad())
throw pybind11::value_error("Path '" + path + "' does not exists.");
return getShellPtr()->doDelete(ObjId(path));
}

Expand Down
6 changes: 2 additions & 4 deletions python/moose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def connect(src, srcfield, dest, destfield, msgtype="Single"):


def delete(arg):
"""Delete the underlying moose object(s). This does not delete any of the
Python objects referring to this vec but does invalidate them. Any
attempt to access them will raise a ValueError.
"""Delete the underlying moose object(s).

Parameters
----------
Expand All @@ -227,7 +225,7 @@ def delete(arg):

Returns
-------
None
None, Raises ValueError if given path/object does not exists.
"""
_moose.delete(arg)

Expand Down