Skip to content

Commit

Permalink
hilda_client: Fix force_return and retval
Browse files Browse the repository at this point in the history
  • Loading branch information
netanelc305 committed Jun 6, 2024
1 parent 1e3eb67 commit 9613692
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hilda/hilda_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
from pathlib import Path
from typing import Any, Callable, List, Optional, Union

import hexdump
import IPython
import hexdump
from IPython.core.magic import register_line_magic # noqa: F401
from humanfriendly import prompts
from humanfriendly.terminal.html import html_to_ansi
from IPython.core.magic import register_line_magic # noqa: F401
from pygments import highlight
from pygments.formatters import TerminalTrueColorFormatter
from pygments.lexers import XmlLexer
Expand Down Expand Up @@ -524,7 +524,7 @@ def callback(hilda, frame, bp_loc, options):
value = hilda.symbol(hilda.evaluate_expression(name))
log_message += f'\n\t{name} = {hilda._monitor_format_value(fmt, value)}'

if options.get('force_return', False):
if options.get('force_return', None) is not None:
hilda.force_return(options['force_return'])
log_message += f'\nforced return: {options["force_return"]}'

Expand All @@ -533,7 +533,7 @@ def callback(hilda, frame, bp_loc, options):
hilda.finish()
hilda.bt()

if options.get('retval', False):
if options.get('retval', None) is not None:
# return from function
hilda.finish()
value = hilda.evaluate_expression('$arg1')
Expand Down

0 comments on commit 9613692

Please sign in to comment.