()
| 40 | |
| 41 | |
| 42 | def display_debug_info(): |
| 43 | echo(' - global sys.executable: `{0}`'.format(sys.executable)) |
| 44 | echo(' - global sys.version: `{0}`'.format( |
| 45 | ', '.join([x.strip() |
| 46 | for x in sys.version.split('\n')]))) |
| 47 | echo(' - global site module: `{0}`'.format(__import__('site').__file__)) |
| 48 | |
| 49 | try: |
| 50 | import jedi_vim |
| 51 | except Exception: |
| 52 | echo_error('ERROR: could not import jedi_vim: {0}'.format( |
| 53 | format_exc_info())) |
| 54 | return |
| 55 | |
| 56 | if jedi_vim.jedi is None: |
| 57 | if hasattr(jedi_vim, 'jedi_import_error'): |
| 58 | error_msg = format_exc_info(jedi_vim.jedi_import_error) |
| 59 | else: |
| 60 | error_msg = 'unknown error' |
| 61 | echo_error('ERROR: could not import the "jedi" Python module: {0}'.format( |
| 62 | error_msg)) |
| 63 | else: |
| 64 | echo('\n##### Jedi\n\n - path: `{0}`'.format(jedi_vim.jedi.__file__)) |
| 65 | echo(' - version: {0}'.format(jedi_vim.jedi.__version__)) |
| 66 | |
| 67 | try: |
| 68 | project = jedi_vim.get_project() |
| 69 | environment = project.get_environment() |
| 70 | except AttributeError: |
| 71 | script_evaluator = jedi_vim.jedi.Script('')._evaluator |
| 72 | try: |
| 73 | sys_path = script_evaluator.project.sys_path |
| 74 | except AttributeError: |
| 75 | sys_path = script_evaluator.sys_path |
| 76 | else: |
| 77 | echo('\n##### Jedi environment: {0}\n\n'.format(environment)) |
| 78 | echo(' - executable: {0}'.format(environment.executable)) |
| 79 | try: |
| 80 | sys_path = environment.get_sys_path() |
| 81 | except Exception: |
| 82 | echo_error('ERROR: failed to get sys path from environment: {0}'.format( |
| 83 | format_exc_info())) |
| 84 | return |
| 85 | |
| 86 | echo(' - sys_path:') |
| 87 | for p in sys_path: |
| 88 | echo(' - `{0}`'.format(p)) |
| 89 | |
| 90 | if environment: |
| 91 | echo('\n##### Known environments\n\n') |
| 92 | for environment in get_known_environments(): |
| 93 | echo(' - {0} ({1})\n'.format( |
| 94 | environment, |
| 95 | environment.executable, |
| 96 | )) |
nothing calls this directly
no test coverage detected