(self, script_name)
| 766 | safe_execv(cmdline) |
| 767 | |
| 768 | def execute_script(self, script_name): |
| 769 | # type: (str) -> Any |
| 770 | dists = list(self.activate()) |
| 771 | |
| 772 | dist_entry_point = get_entry_point_from_console_script(script_name, dists) |
| 773 | if dist_entry_point: |
| 774 | TRACER.log( |
| 775 | "Found {console_script}.".format( |
| 776 | console_script=dist_entry_point.render_description() |
| 777 | ) |
| 778 | ) |
| 779 | return self.execute_entry(dist_entry_point.entry_point) |
| 780 | |
| 781 | dist_script = get_script_from_distributions(script_name, dists) |
| 782 | if not dist_script: |
| 783 | return "Could not find script {!r} in pex!".format(script_name) |
| 784 | |
| 785 | TRACER.log("Found script {!r} in {!r}.".format(script_name, dist_script.dist)) |
| 786 | ast = dist_script.python_script() |
| 787 | if ast: |
| 788 | return self.execute_ast(dist_script.path, ast, argv0=script_name) |
| 789 | else: |
| 790 | return self.execute_external(dist_script.path) |
| 791 | |
| 792 | @staticmethod |
| 793 | def execute_external(binary): |
no test coverage detected