问题:报错TypeError: 'int' object is not callable

Traceback (most recent call last):
  File "E:\python2.7\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "E:\python2.7\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "E:\python2.7\lib\site-packages\flask_restplus\api.py", line 313, in wrapper
    resp = resource(*args, **kwargs)
  File "E:\python2.7\lib\site-packages\flask\views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "E:\python2.7\lib\site-packages\flask_restplus\resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "I:\senseware\mongo\services\auth_decorator.py", line 31, in decorated
    return f(*args, **kwargs)
  File "I:\senseware\mongo\routes\remote_maintenance.py", line 191, in post
    result = remote_maintenance_service.end_test_machine(mode, SOID)
  File "I:\senseware\mongo\services\remote_maintenance_service.py", line 45, in end_test_machine
    return remote_maintenance_db.end_oil_machine(mode, SOID)
  File "I:\senseware\mongo\database\remote_maintenance_db.py", line 446, in end_oil_machine
    update_database_oil_machine_state(SOID, mode, start_t=task_id["start_time"])
  File "I:\senseware\mongo\database\remote_maintenance_db.py", line 471, in update_database_oil_machine_state
    set_message["time_str"] = (update_time - start_t).seconds()
TypeError: 'int' object is not callable

使用datetime相减,报错,百度出来的结果是说是因为变量名取重复了,于是尝试着更改一下变量的名称,但是没有作用,发现是

seconds()加了括号,把括号去掉后,就正常了

你可能感兴趣的:(python项目开发)