From 961369209ba1cb7041b7ea3dd56302cb184a55df Mon Sep 17 00:00:00 2001 From: Netanel Cohen Date: Thu, 6 Jun 2024 15:13:45 +0300 Subject: [PATCH] hilda_client: Fix `force_return` and `retval` --- hilda/hilda_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hilda/hilda_client.py b/hilda/hilda_client.py index 0e5b3d0..897c483 100644 --- a/hilda/hilda_client.py +++ b/hilda/hilda_client.py @@ -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 @@ -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"]}' @@ -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')