Skip to content

Commit 4e85c3b

Browse files
Fix tool crash
Fixes #282
1 parent 5693a6e commit 4e85c3b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Not quite compatible with Octave yet. See #43 [octave support](https://github.co
2929
* Fix parser error for enumeration values with no parameters using
3030
brackets.
3131

32+
* Fix tool crash when `--debug-dump-tree` was specified without
33+
`--single`. This is now clear in the error message.
34+
3235
* Add new configuration directive `ignore_dir`. This works just like
3336
`exclude_dir` but does not raise an error if the directory doesn't
3437
exist.

miss_hit_core/mh_style.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## ##
44
## MATLAB Independent, Small & Safe, High Integrity Tools ##
55
## ##
6-
## Copyright (C) 2019-2022, Florian Schanda ##
6+
## Copyright (C) 2019-2024, Florian Schanda ##
77
## Copyright (C) 2019-2020, Zenuity AB ##
88
## ##
99
## This file is part of MISS_HIT. ##
@@ -1283,9 +1283,12 @@ def main_handler():
12831283

12841284
# pylint: disable=consider-using-with
12851285
if options.debug_dump_tree:
1286-
extra_options["fd_tree"] = open(options.debug_dump_tree,
1287-
"w",
1288-
encoding="UTF-8")
1286+
if options.single:
1287+
extra_options["fd_tree"] = open(options.debug_dump_tree,
1288+
"w",
1289+
encoding="UTF-8")
1290+
else:
1291+
clp["ap"].error("The debug_dump_tree requires the --single option")
12891292
# pylint: enable=consider-using-with
12901293

12911294
style_backend = MH_Style()

0 commit comments

Comments
 (0)