MCPcopy Create free account
hub / github.com/microsoft/debugpy / _get_handler_for

Method _get_handler_for

src/debugpy/common/messaging.py:1465–1484  ·  view source on GitHub ↗

Returns the handler for a message of a given type.

(self, type, name)

Source from the content-addressed store, hash-verified

1463 os._exit(1)
1464
1465 def _get_handler_for(self, type, name):
1466 """Returns the handler for a message of a given type."""
1467
1468 with self:
1469 handlers = self.handlers
1470
1471 for handler_name in (name + "_" + type, type):
1472 try:
1473 return getattr(handlers, handler_name)
1474 except AttributeError:
1475 continue
1476
1477 raise AttributeError(
1478 "handler object {0} for channel {1} has no handler for {2} {3!r}".format(
1479 util.srcnameof(handlers),
1480 self,
1481 type,
1482 name,
1483 )
1484 )
1485
1486 def _handle_disconnect(self):
1487 handler = getattr(self.handlers, "disconnect", lambda: None)

Callers 2

_handleMethod · 0.80
_handleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected