“绑定方法PythonBreakpoint._ActivateBreakpoint”是什么意思?

时间:2018-12-13 01:58:44

标签: python python-2.7 google-app-engine stackdriver

我正在使用python webapp2(在GAE中使用)。 我在日志记录中看到了此异常。

<bound method PythonBreakpoint._ActivateBreakpoint of <google.devtools.cdbg.debuglets.python.python_breakpoint.PythonBreakpoint object at 0x2ab09434da10>>

Traceback (most recent call last):
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1272, in default_dispatcher
    self.handlers[handler] = handler = import_string(handler)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1850, in import_string
    return getattr(__import__(module, None, None, [obj]), obj)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/imphook2.py", line 222, in _ImportHookBySuffix
    _ProcessImportBySuffix(name, fromlist, globals)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/imphook2.py", line 179, in _ProcessImportBySuffix
    _InvokeImportCallbackBySuffix(_import_local.names)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/imphook2.py", line 452, in _InvokeImportCallbackBySuffix
    callback(module)
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/python_breakpoint.py", line 317, in _ActivateBreakpoint
    self._RemoveImportHook()
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/python_breakpoint.py", line 398, in _RemoveImportHook
    self._import_hook_cleanup()
  File "/base/alloc/tmpfs/dynamic_runtimes/python27g/d22767677e9aa897/python27/python27_lib/versions/1/google/devtools/cdbg/debuglets/python/imphook2.py", line 109, in RemoveCallback
    callbacks.remove(callback)

KeyError: <bound method PythonBreakpoint._ActivateBreakpoint of <google.devtools.cdbg.debuglets.python.python_breakpoint.PythonBreakpoint object at 0x2ab09434da10>>

这是我的代码。

import webapp2
ROUTES = [
    webapp2.Route('/sample', handler='sample_package.SampleClass', methods=['POST']),
...
]

APPLICATION = webapp2.WSGIApplication(
    ROUTES,
    config=config)

此异常并非每次都发生。

这是什么意思,我该如何删除? 有问题吗?

1 个答案:

答案 0 :(得分:1)

您是否在调用不带()的函数?

a = b.func()a = b.func

如果不包含括号,则可能是返回对函数的引用,而不是函数的输出。