From 328b62350a87932dc6469356c1926469e1630d05 Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Sat, 3 Mar 2018 03:55:13 +0700 Subject: [PATCH] Change assertion->exception and add msg when target file is not present (#778) --- manticore/manticore.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manticore/manticore.py b/manticore/manticore.py index 9c7e6d7..768da32 100644 --- a/manticore/manticore.py +++ b/manticore/manticore.py @@ -168,10 +168,13 @@ class Manticore(Eventful): self.forward_events_from(self._executor) if isinstance(path_or_state, str): - assert os.path.isfile(path_or_state) + if not os.path.isfile(path_or_state): + raise Exception('{} is not an existing regular file'.format(path_or_state)) self._initial_state = make_initial_state(path_or_state, argv=argv, **kwargs) elif isinstance(path_or_state, State): self._initial_state = path_or_state + else: + raise TypeError('path_or_state must be either a str or State, not {}'.format(type(path_or_state).__name__)) if not isinstance(self._initial_state, State): raise TypeError("Manticore must be intialized with either a State or a path to a binary")