def exception_test(): #??????? stockid = '002316' df = ts.get_hist_data(stockid, start='20160601', end='20160701') if df.empty: print "empty"