#! /usr/bin/env python2

import traceback

def fun():
  try:
    x = 0 / 0
  except Exception as e:
    print 'Caught {e!s}'.format(**locals())
    print 'stack: <{stack!r}>'.format(stack=traceback.format_exc())

fun()
