'Attempt at an IRC client.'
from contextlib import contextmanager
-from inspect import _empty as inspect_empty, signature
+from inspect import _empty as inspect_empty, signature, stack
from queue import SimpleQueue, Empty as QueueEmpty
from signal import SIGWINCH, signal
from socket import socket
if len(self._prompt) > 1 and self._prompt[0] == '/':
toks = self._prompt[1:].split(maxsplit=1)
method_name = f'_cmd__{toks[0]}'
- if hasattr(self, method_name):
+ if hasattr(self, method_name)\
+ and method_name != stack()[0].function:
method = getattr(self, method_name)
params = signature(method).parameters
n_args_max = len(params)