(self, lines, exe_pth=True)
| 653 | |
| 654 | if sys.platform == 'win32': |
| 655 | def _create_underpth_exe(self, lines, exe_pth=True): |
| 656 | import _winapi |
| 657 | temp_dir = tempfile.mkdtemp() |
| 658 | self.addCleanup(os_helper.rmtree, temp_dir) |
| 659 | exe_file = os.path.join(temp_dir, os.path.split(sys.executable)[1]) |
| 660 | dll_src_file = _winapi.GetModuleFileName(sys.dllhandle) |
| 661 | dll_file = os.path.join(temp_dir, os.path.split(dll_src_file)[1]) |
| 662 | shutil.copy(sys.executable, exe_file) |
| 663 | shutil.copy(dll_src_file, dll_file) |
| 664 | for fn in glob.glob(os.path.join(os.path.split(dll_src_file)[0], "vcruntime*.dll")): |
| 665 | shutil.copy(fn, os.path.join(temp_dir, os.path.split(fn)[1])) |
| 666 | if exe_pth: |
| 667 | _pth_file = os.path.splitext(exe_file)[0] + '._pth' |
| 668 | else: |
| 669 | _pth_file = os.path.splitext(dll_file)[0] + '._pth' |
| 670 | with open(_pth_file, 'w', encoding='utf8') as f: |
| 671 | for line in lines: |
| 672 | print(line, file=f) |
| 673 | return exe_file |
| 674 | else: |
| 675 | def _create_underpth_exe(self, lines, exe_pth=True): |
| 676 | if not exe_pth: |
no test coverage detected