One way to handle this is to put this task into a thread, and use a watchdog to kill it after 90 seconds have passed.
Here's a recipe at ActiveState.
Edit: Obviously, the recipe by itself is not the complete solution. You would either have a watchdog thread that checked every x seconds if the worker thread was done, or you would go to an event framework like Michael Ford's simple event framework.