错误原因:

Python 3 已弃用 has_key 这一方法。

错误代码:

1 if all_attendances.has_key(_start):          
2         _attendance = all_attendances[_start]
3         stats.add_attendance(_attendance.clock_in, _attendance.clock_out, 1)

修改后的代码:

1    if _start in all_attendances:   
2        _attendance = all_attendances[_start]
3        stats.add_attendance(_attendance.clock_in, _attendance.clock_out, 1)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
猜你喜欢
  • 2021-10-23
  • 2022-12-23
  • 2021-09-27
  • 2021-05-19
  • 2022-12-23
  • 2022-01-11
相关资源
相似解决方案