(self, lines, exe_pth=True)
| 666 | |
| 667 | if sys.platform == 'win32': |
| 668 | def _create_underpth_exe(self, lines, exe_pth=True): |
| 669 | import _winapi |
| 670 | temp_dir = tempfile.mkdtemp() |
| 671 | self.addCleanup(os_helper.rmtree, temp_dir) |
| 672 | exe_file = os.path.join(temp_dir, os.path.split(sys.executable)[1]) |
| 673 | dll_src_file = _winapi.GetModuleFileName(sys.dllhandle) |
| 674 | dll_file = os.path.join(temp_dir, os.path.split(dll_src_file)[1]) |
| 675 | shutil.copy(sys.executable, exe_file) |
| 676 | shutil.copy(dll_src_file, dll_file) |
| 677 | for fn in glob.glob(os.path.join(os.path.split(dll_src_file)[0], "vcruntime*.dll")): |
| 678 | shutil.copy(fn, os.path.join(temp_dir, os.path.split(fn)[1])) |
| 679 | if exe_pth: |
| 680 | _pth_file = os.path.splitext(exe_file)[0] + '._pth' |
| 681 | else: |
| 682 | _pth_file = os.path.splitext(dll_file)[0] + '._pth' |
| 683 | with open(_pth_file, 'w', encoding='utf8') as f: |
| 684 | for line in lines: |
| 685 | print(line, file=f) |
| 686 | return exe_file |
| 687 | else: |
| 688 | def _create_underpth_exe(self, lines, exe_pth=True): |
| 689 | if not exe_pth: |
no test coverage detected