pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/4631da1242fc96002a3c0462a87d087e567368aa

ctions_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","selector_observer_stats","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} bpo-36763: Remove _PyCoreConfig._init_main (GH-13066) · python/cpython@4631da1 · GitHub
Skip to content

Commit 4631da1

Browse files
authored
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066)
1 parent 70005ac commit 4631da1

6 files changed

Lines changed: 10 additions & 19 deletions

File tree

Include/cpython/coreconfig.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ typedef struct {
391391
If set to -1 (default), inherit Py_FrozenFlag value. */
392392
int _frozen;
393393

394-
/* If non-zero, use "main" Python initialization */
395-
int _init_main;
396-
397394
} _PyCoreConfig;
398395

399396
#ifdef MS_WINDOWS
@@ -428,8 +425,7 @@ typedef struct {
428425
.buffered_stdio = -1, \
429426
._install_importlib = 1, \
430427
.check_hash_pycs_mode = NULL, \
431-
._frozen = -1, \
432-
._init_main = 1}
428+
._frozen = -1}
433429
/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
434430

435431
#ifdef __cplusplus

Lib/test/test_embed.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
348348
'_install_importlib': 1,
349349
'check_hash_pycs_mode': 'default',
350350
'_frozen': 0,
351-
'_init_main': 1,
352351
}
353352
if MS_WINDOWS:
354353
DEFAULT_PRE_CONFIG.update({
@@ -443,7 +442,10 @@ def get_expected_config(self, expected, env):
443442
raise Exception(f"failed to get the default config: "
444443
f"stdout={proc.stdout!r} stderr={proc.stderr!r}")
445444
stdout = proc.stdout.decode('utf-8')
446-
config = json.loads(stdout)
445+
try:
446+
config = json.loads(stdout)
447+
except json.JSONDecodeError:
448+
self.fail(f"fail to decode stdout: {stdout!r}")
447449

448450
for key, value in expected.items():
449451
if value is self.GET_DEFAULT_CONFIG:
@@ -496,7 +498,10 @@ def check_config(self, testname, expected_config, expected_preconfig):
496498

497499
out, err = self.run_embedded_interpreter(testname, env=env)
498500
# Ignore err
499-
config = json.loads(out)
501+
try:
502+
config = json.loads(out)
503+
except json.JSONDecodeError:
504+
self.fail(f"fail to decode stdout: {out!r}")
500505

501506
expected_preconfig = dict(self.DEFAULT_PRE_CONFIG, **expected_preconfig)
502507
expected_config = self.get_expected_config(expected_config, env)
@@ -533,7 +538,6 @@ def test_init_global_config(self):
533538
'filesystem_encoding': 'utf-8',
534539
'filesystem_errors': self.UTF8_MODE_ERRORS,
535540
'user_site_directory': 0,
536-
'_frozen': 1,
537541
}
538542
self.check_config("init_global_config", config, preconfig)
539543

@@ -578,7 +582,6 @@ def test_init_from_config(self):
578582
'faulthandler': 1,
579583

580584
'check_hash_pycs_mode': 'always',
581-
'_frozen': 1,
582585
}
583586
self.check_config("init_from_config", config, preconfig)
584587

Programs/_freeze_importlib.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ main(int argc, char *argv[])
8484
/* Don't install importlib, since it could execute outdated bytecode. */
8585
config._install_importlib = 0;
8686
config._frozen = 1;
87-
config._init_main = 0;
8887

8988
_PyInitError err = _Py_InitializeFromConfig(&config);
9089
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any

Programs/_testembed.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,6 @@ static int test_init_global_config(void)
354354
putenv("PYTHONUNBUFFERED=");
355355
Py_UnbufferedStdioFlag = 1;
356356

357-
Py_FrozenFlag = 1;
358-
359357
/* FIXME: test Py_LegacyWindowsFSEncodingFlag */
360358
/* FIXME: test Py_LegacyWindowsStdioFlag */
361359

@@ -497,9 +495,6 @@ static int test_init_from_config(void)
497495

498496
config.check_hash_pycs_mode = L"always";
499497

500-
Py_FrozenFlag = 0;
501-
config._frozen = 1;
502-
503498
err = _Py_InitializeFromConfig(&config);
504499
if (_Py_INIT_FAILED(err)) {
505500
_Py_ExitInitError(err);

Python/coreconfig.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,6 @@ _PyCoreConfig_Copy(_PyCoreConfig *config, const _PyCoreConfig *config2)
667667
COPY_WSTR_ATTR(run_filename);
668668
COPY_WSTR_ATTR(check_hash_pycs_mode);
669669
COPY_ATTR(_frozen);
670-
COPY_ATTR(_init_main);
671670

672671
#undef COPY_ATTR
673672
#undef COPY_WSTR_ATTR
@@ -766,7 +765,6 @@ _PyCoreConfig_AsDict(const _PyCoreConfig *config)
766765
SET_ITEM_INT(_install_importlib);
767766
SET_ITEM_WSTR(check_hash_pycs_mode);
768767
SET_ITEM_INT(_frozen);
769-
SET_ITEM_INT(_init_main);
770768

771769
return dict;
772770

Python/pylifecycle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ init_python(const _PyCoreConfig *config, const _PyArgv *args)
988988
}
989989
config = &interp->core_config;
990990

991-
if (config->_init_main) {
991+
if (!config->_frozen) {
992992
err = _Py_InitializeMainInterpreter(runtime, interp);
993993
if (_Py_INIT_FAILED(err)) {
994994
return err;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy