Call the magic alias.
(self, *args, **kwargs)
| 683 | self._in_call = False |
| 684 | |
| 685 | def __call__(self, *args, **kwargs): |
| 686 | """Call the magic alias.""" |
| 687 | fn = self.shell.find_magic(self.magic_name, self.magic_kind) |
| 688 | if fn is None: |
| 689 | raise UsageError("Magic `%s` not found." % self.pretty_target) |
| 690 | |
| 691 | # Protect against infinite recursion. |
| 692 | if self._in_call: |
| 693 | raise UsageError("Infinite recursion detected; " |
| 694 | "magic aliases cannot call themselves.") |
| 695 | self._in_call = True |
| 696 | try: |
| 697 | if self.magic_params: |
| 698 | args_list = list(args) |
| 699 | args_list[0] = self.magic_params + " " + args[0] |
| 700 | args = tuple(args_list) |
| 701 | return fn(*args, **kwargs) |
| 702 | finally: |
| 703 | self._in_call = False |
nothing calls this directly
no test coverage detected