Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_namespace(self, path=""):
try:
return self._namespace_by_path[path]
except KeyError:
raise PacketError("undefined socket.io namespace (%s)" % path)
def get_namespace(self):
try:
return self._namespace
except AttributeError:
raise PacketError("undefined engine.io namespace")
def _on_event(self, packet):
args = packet.args
try:
event = args.pop(0)
except IndexError:
raise PacketError("missing event name")
if packet.ack_id is not None:
args.append(self._prepare_to_send_ack(packet.path, packet.ack_id))
packet.namespace._find_packet_callback(event)(*args)
def _process_packets(self):
for engineIO_packet in self._transport.recv_packet():
try:
self._process_packet(engineIO_packet)
except PacketError as e:
self._warn("[packet error] %s", e)