Skip to content

Commit

Permalink
Add deprecation warnings for outdated API members (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hennenfent committed Jul 31, 2019
1 parent f9b13b9 commit a434ebf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ value = m.make_symbolic_value()

contract_account.incremented(value)

for state in m.running_states:
for state in m.ready_states:
print("can value be 1? {}".format(state.can_be_true(value == 1)))
print("can value be 200? {}".format(state.can_be_true(value == 200)))
```
Expand All @@ -98,7 +98,7 @@ def hook(state):
print('eax', cpu.EAX)
print(cpu.read_int(cpu.ESP))

m.terminate() # tell Manticore to stop
m.kill() # tell Manticore to stop

m.run()
```
Expand Down
11 changes: 11 additions & 0 deletions manticore/core/manticore.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ def ready_states(self):
# Re-save the state in case the user changed its data
self._save(state, state_id=state_id)

@property
def running_states(self):
logger.warning(
"manticore.running_states is deprecated! (You probably want manticore.ready_states)"
)
return self.ready_states

@property
@sync
def terminated_states(self):
Expand Down Expand Up @@ -808,6 +815,10 @@ def kill(self):
self._killed.value = True
self._lock.notify_all()

def terminate(self):
logger.warning("manticore.terminate is deprecated (Use manticore.kill)")
self.kill()

@sync
def is_running(self):
""" True if workers are exploring BUSY states or waiting for READY states """
Expand Down

0 comments on commit a434ebf

Please sign in to comment.