python rrdtool尝试除rrdtool。错误模块对象没有属性错误

我有这段代码,它在Linux上给出了这个错误,如果您能提供帮助,我将不胜感激

选择 | 换行 | 行号
  1. import rrdtool
  2.  
  3. try:      
  4.       ret_asd = rrdtool.update(myfile.rrd,'N:%s:%s' %(metric1, metric2));    
  5. except rrdtool.error, e:
  6.       print e 
  7.  

当我运行上面的程序时,我得到以下错误

选择 | 换行 | 行号
  1. except rrdtool.error, e:
  2. AttributeError: 'module' object has no attribute 'error'
  3.  

该代码旨在跳过以下错误

选择 | 换行 | 行号
  1. illegal attempt to update using time 1363358441 when last update time is 1363358441 (minimum one second step)
  2.  

如果你能帮我找到解决方案,我将不胜感激谢谢

标签: python

添加新评论