Skip to content

Instantly share code, notes, and snippets.

@pyKun
Last active December 19, 2015 12:28
Show Gist options
  • Save pyKun/5954607 to your computer and use it in GitHub Desktop.
Save pyKun/5954607 to your computer and use it in GitHub Desktop.
over covering on sys.exc_info()
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Author: Kun Huang <academicgareth@gmail.com>
# Created Time: 06/06/13 22:23:18 (CST)
# Modified Time: 07/09/13 12:03:40 (CST)
import sys
try:
raise ValueError('ddd')
except Exception as dd:
dd_exc = sys.exc_info()
try:
raise ValueError('eee')
except Exception as ee:
pass
raise dd_exc[0], dd_exc[1], dd_exc[2] # this raise dd
#raise dd_exc # this raise doesn't work
#raise # this raise ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment