2015-07-10 73 views
1

我试图找出如何得到的异常,显示此功能追赶在clone_saved_pa​​th)异常(

clone_saved_path(): 

def clone_saved_path(): 

      except OSError as e: 
       # If the error was caused because the source wasn't a directory 
       print('Directory not copied. Error: %s' % e) 
       print("got here. [4]") 
      except: 
       print("Another error occurred in clone_saved_path() ") 
       print("got here. [5]") 

当我运行我的代码,它击中最后except块并且输出:

print("Another error occurred in clone_saved_path() ") 

我知道这听起来简单,但是我需要弄清楚如何显示实际例外。

回答