title: Using sys.exit or SystemExit; when to use which?
body: <p>Some programmers use <code>sys.exit</code>, others use <code>SystemExit</code>.</p>
  <ol>
  <li>What is the difference?</li>
  <li>When do I need to use <code>SystemExit</code> or <code>sys.exit</code> inside a function?</li>
  </ol>
  <p>Example:</p>
  <pre><code>ref = osgeo.ogr.Open(reference)
  if ref is None:
      raise SystemExit('Unable to open %s' % reference)
  </code></pre>
  <p>or:</p>
  <pre><code>ref = osgeo.ogr.Open(reference)
  if ref is None:
      print('Unable to open %s' % reference)
      sys.exit(-1)
  </code></pre>