Logo
Explore Help
Sign In
1berry/cpython
1
0
Fork 0
You've already forked cpython
Code Issues Packages Projects Releases Wiki Activity
cpython/Programs/test_frozenmain.py

18 lines
444 B
Python
Raw Permalink Normal View History

bpo-44131: Fix Makefile for test_frozenmain (GH-26203) Remove Programs/test_frozenmain.h Makefile target: it ran make in parallel which caused build errors on LTO+PGO builds.
2021-05-18 08:40:37 +02:00
# Script used to test Py_FrozenMain(): see test_embed.test_frozenmain().
# Run "make regen-test-frozenmain" if you modify this test.
bpo-44131: Test Py_FrozenMain() (GH-26126) * Add test_frozenmain to test_embed * Add Programs/test_frozenmain.py * Add Programs/freeze_test_frozenmain.py * Add Programs/test_frozenmain.h * Add make regen-test-frozenmain * Add test_frozenmain command to Programs/_testembed * _testembed.c: add error(msg) function
2021-05-17 23:48:35 +02:00
import sys
import _testinternalcapi
print("Frozen Hello World")
print("sys.argv", sys.argv)
config = _testinternalcapi.get_configs()['config']
bpo-44131: Py_FrozenMain() uses PyConfig_SetBytesArgv() (GH-26201) Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to handle the PYTHONUNBUFFERED environment variable and configure C stdio streams like stdout (make the stream unbuffered).
2021-05-20 12:08:05 +02:00
for key in (
'program_name',
'executable',
'use_environment',
'configure_c_stdio',
'buffered_stdio',
):
print(f"config {key}: {config[key]}")
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 935ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API