If you have completely separate tasks to perform depending on which function worked, as your code shows, then separate try / exec blocks, as existing answers suggest, may be better (although you probably might need to skip the second if the first of them failed).
, , , - , , , , , traceback Python :
import os, sys, traceback
try:
os.mkdir('/valid_created_dir')
os.listdir('/invalid_path')
except OSError, msg:
tb = sys.exc_info()[-1]
stk = traceback.extract_tb(tb, 1)
fname = stk[0][2]
print 'The failing function was', fname
, print if, , .