mirror of
https://github.com/python/cpython.git
synced 2024-11-23 09:54:58 +08:00
gh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)
This commit is contained in:
parent
9effa0ff06
commit
802d405ff1
@ -872,6 +872,27 @@ class BasicTest(BaseTest):
|
|||||||
else:
|
else:
|
||||||
self.assertFalse(same_path(path1, path2))
|
self.assertFalse(same_path(path1, path2))
|
||||||
|
|
||||||
|
# gh-126084: venvwlauncher should run pythonw, not python
|
||||||
|
@requireVenvCreate
|
||||||
|
@unittest.skipUnless(os.name == 'nt', 'only relevant on Windows')
|
||||||
|
def test_venvwlauncher(self):
|
||||||
|
"""
|
||||||
|
Test that the GUI launcher runs the GUI python.
|
||||||
|
"""
|
||||||
|
rmtree(self.env_dir)
|
||||||
|
venv.create(self.env_dir)
|
||||||
|
exename = self.exe
|
||||||
|
# Retain the debug suffix if present
|
||||||
|
if "python" in exename and not "pythonw" in exename:
|
||||||
|
exename = exename.replace("python", "pythonw")
|
||||||
|
envpyw = os.path.join(self.env_dir, self.bindir, exename)
|
||||||
|
try:
|
||||||
|
subprocess.check_call([envpyw, "-c", "import sys; "
|
||||||
|
"assert sys._base_executable.endswith('%s')" % exename])
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
self.fail("venvwlauncher.exe did not run %s" % exename)
|
||||||
|
|
||||||
|
|
||||||
@requireVenvCreate
|
@requireVenvCreate
|
||||||
class EnsurePipTest(BaseTest):
|
class EnsurePipTest(BaseTest):
|
||||||
"""Test venv module installation of pip."""
|
"""Test venv module installation of pip."""
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
Fix venvwlauncher to launch pythonw instead of python so no extra console
|
||||||
|
window is created.
|
@ -92,7 +92,7 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>EXENAME=L"$(PyExeName)$(PyDebugExt).exe";_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>EXENAME=L"$(PyWExeName)$(PyDebugExt).exe";_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ResourceCompile>
|
<ResourceCompile>
|
||||||
|
Loading…
Reference in New Issue
Block a user