# sys.exit() command fails in paraview 5.7

**URL:** https://discourse.paraview.org/t/sys-exit-command-fails-in-paraview-5-7/5826
**Category:** ParaView Support
**Created:** [November 17, 2020, 8:23am UTC](https://discourse.paraview.org/t/sys-exit-command-fails-in-paraview-5-7/5826 "2020-11-17T08:23:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aerogt3](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/3bc359/32.png) [@aerogt3](https://discourse.paraview.org/u/aerogt3)
#### Post date: [November 17, 2020, 8:23am UTC](https://discourse.paraview.org/t/sys-exit-command-fails-in-paraview-5-7/5826/1 "2020-11-17T08:23:13Z")

</div>

I have a python script which is often run in batch on a server, but also run locally to load and setup data for manual visualization (and to debug/write the scripts). I have many sys.exit() calls which catch common errors, or just end the script early. When running interactively, anytime the sys.exit() call is made, paraview throws the errors below and stdout and stderr are lost.

What’s the proper way to stop a python script in paraview interactive? Or is this a bug? In 5.4.1 for example, sys.exit() functions normally.

It’s easy to reproduce this with:  
test.py:

> ```
> import paraview
> from paraview.simple import *
> sys.exit()
> 
> ```

And thenL  
/opt/paraview/5.7.0/bin/paraview --script=test.py

> AutoMPI: SUCCESS: command is:  
> “/opt/paraview/5.7.0/bin/mpiexec” “-n” “11” “/opt/paraview/5.7.0/bin/pvserver” “–server-port=41095”  
> AutoMPI: starting process server  
> -------------- server output --------------  
> Waiting for client…  
> AutoMPI: server successfully started.
> 
> Loguru caught a signal: SIGSEGV  
> corrupted size vs. prev\_size
> 
> Loguru caught a signal: SIGABRT
