Skip to content

Commit

Permalink
Merge pull request dipy#3293 from jhlegarreta/FixFrameLocalTableObjec…
Browse files Browse the repository at this point in the history
…tDeletion

BF: Fix attempting to delete frame local symbol table variable
  • Loading branch information
skoudoro authored Sep 5, 2024
2 parents 2ea0906 + f808ccc commit e0e6244
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions dipy/workflows/multi_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,28 @@ def _io_iterator(frame, fnc, *, output_strategy="absolute", mix_names=False):
Contains the info about the current local variables values.
fnc : function
The function to inspect
output_strategy : string
output_strategy : string, optional
Controls the behavior of the IOIterator for output paths.
mix_names : bool
mix_names : bool, optional
Whether or not to append a mix of input names at the beginning.
Returns
-------
Properly instantiated IOIterator object.
"""

# Create a new object that does not contain the ``self`` dict item
def _selfless_dict(_values):
return {key: val for key, val in _values.items() if key != "self"}

args, _, _, values = inspect.getargvalues(frame)
args.remove("self")
del values["self"]
# Create a new object that does not contain the ``self`` dict item from the
# provided copy of the local symbol table returned by ``getargvalues``.
# Avoids attempting to remove it from the object returned by
# ``getargvalues``.
values = _selfless_dict(values)

spargs, defaults = get_args_default(fnc)

Expand Down

0 comments on commit e0e6244

Please sign in to comment.