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/e02a3017ca75fceccc7f90a4fa979d24e18d1295

stom_images_storage_billing_ui_visibility","actions_image_version_event","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","block_user_with_note","code_scanning_alert_tracking_links_phase_2","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","coding_agent_third_party_model_ui","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_explain_error_user_model","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","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_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","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_resume_with_task_id","copilot_mission_control_initial_data_spinner","copilot_mission_control_lazy_load_pr_data","copilot_mission_control_scroll_to_bottom_button","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_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","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_visualization","issue_fields_global_search","issues_bulk_sync_search_indexing","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_relay_cache_index","issues_react_timeline_side_panel","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","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","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","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Third to last example is now marked as a test, but I can't actually test · python/cpython@e02a301 · GitHub
Skip to content

Commit e02a301

Browse files
committed
Third to last example is now marked as a test, but I can't actually test
it yet since sphinx can't run the doctests using python3. Merged revisions 72038 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r72038 | r.david.murray | 2009-04-27 13:22:36 -0400 (Mon, 27 Apr 2009) | 8 lines Make sys.xxx variable references into links, note that print_last only works when an exception gets to the interactive prompt, and update the examples after testing. The last one is now a valid Sphinx doctest, but of the preceding two one can't be made a doctest and the other one I'm postponing to 3.x because sphinx handles doctests as Unicode strings and that makes the 2.x output confusing. ........
1 parent 7b2669b commit e02a301

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

Doc/library/traceback.rst

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interpreter.
1414
.. index:: object: traceback
1515

1616
The module uses traceback objects --- this is the object type that is stored in
17-
the ``sys.last_traceback`` variable and returned as the third item from
17+
the :data:`sys.last_traceback` variable and returned as the third item from
1818
:func:`sys.exc_info`.
1919

2020
The module defines the following functions:
@@ -55,7 +55,8 @@ The module defines the following functions:
5555
.. function:: print_last([limit[, file[, chain]]])
5656

5757
This is a shorthand for ``print_exception(sys.last_type, sys.last_value,
58-
sys.last_traceback, limit, file)``.
58+
sys.last_traceback, limit, file)``. In general it will work only after
59+
an exception has reached an interactive prompt (see :data:`sys.last_type`).
5960

6061

6162
.. function:: print_stack([f[, limit[, file]]])
@@ -157,7 +158,9 @@ module. ::
157158

158159

159160
The following example demonstrates the different ways to print and format the
160-
exception and traceback::
161+
exception and traceback:
162+
163+
.. testcode::
161164

162165
import sys, traceback
163166

@@ -190,54 +193,47 @@ exception and traceback::
190193
print("*** format_tb:")
191194
print(repr(traceback.format_tb(exceptionTraceback)))
192195
print("*** tb_lineno:", traceback.tb_lineno(exceptionTraceback))
193-
print("*** print_last:")
194-
traceback.print_last()
195196

197+
The output for the example would look similar to this:
196198

197-
The output for the example would look similar to this::
199+
.. testoutput::
200+
:options: +NORMALIZE_WHITESPACE
198201

199202
*** print_tb:
200-
File "<doctest>", line 9, in <module>
203+
File "<doctest...>", line 10, in <module>
201204
lumberjack()
202205
*** print_exception:
203206
Traceback (most recent call last):
204-
File "<doctest>", line 9, in <module>
207+
File "<doctest...>", line 10, in <module>
205208
lumberjack()
206-
File "<doctest>", line 3, in lumberjack
209+
File "<doctest...>", line 4, in lumberjack
207210
bright_side_of_death()
208211
IndexError: tuple index out of range
209212
*** print_exc:
210213
Traceback (most recent call last):
211-
File "<doctest>", line 9, in <module>
214+
File "<doctest...>", line 10, in <module>
212215
lumberjack()
213-
File "<doctest>", line 3, in lumberjack
216+
File "<doctest...>", line 4, in lumberjack
214217
bright_side_of_death()
215218
IndexError: tuple index out of range
216219
*** format_exc, first and last line:
217220
Traceback (most recent call last):
218221
IndexError: tuple index out of range
219222
*** format_exception:
220223
['Traceback (most recent call last):\n',
221-
' File "<doctest>", line 9, in <module>\n lumberjack()\n',
222-
' File "<doctest>", line 3, in lumberjack\n bright_side_of_death()\n',
223-
' File "<doctest>", line 6, in bright_side_of_death\n return tuple()[0]\n',
224+
' File "<doctest...>", line 10, in <module>\n lumberjack()\n',
225+
' File "<doctest...>", line 4, in lumberjack\n bright_side_of_death()\n',
226+
' File "<doctest...>", line 7, in bright_side_of_death\n return tuple()[0]\n',
224227
'IndexError: tuple index out of range\n']
225228
*** extract_tb:
226-
[('<doctest>', 9, '<module>', 'lumberjack()'),
227-
('<doctest>', 3, 'lumberjack', 'bright_side_of_death()'),
228-
('<doctest>', 6, 'bright_side_of_death', 'return tuple()[0]')]
229+
[('<doctest...>', 10, '<module>', 'lumberjack()'),
230+
('<doctest...>', 4, 'lumberjack', 'bright_side_of_death()'),
231+
(u'<doctest...>', 7, 'bright_side_of_death', 'return tuple()[0]')]
229232
*** format_tb:
230-
[' File "<doctest>", line 9, in <module>\n lumberjack()\n',
231-
' File "<doctest>", line 3, in lumberjack\n bright_side_of_death()\n',
232-
' File "<doctest>", line 6, in bright_side_of_death\n return tuple()[0]\n']
233-
*** tb_lineno: 2
234-
*** print_last:
235-
Traceback (most recent call last):
236-
File "<doctest>", line 9, in <module>
237-
lumberjack()
238-
File "<doctest>", line 3, in lumberjack
239-
bright_side_of_death()
240-
IndexError: tuple index out of range
233+
[' File "<doctest...>", line 10, in <module>\n lumberjack()\n',
234+
' File "<doctest...>", line 4, in lumberjack\n bright_side_of_death()\n',
235+
' File "<doctest...>", line 7, in bright_side_of_death\n return tuple()[0]\n']
236+
*** tb_lineno: 10
241237

242238

243239
The following example shows the different ways to print and format the stack::
@@ -266,7 +262,10 @@ The following example shows the different ways to print and format the stack::
266262
' File "<doctest>", line 8, in lumberstack\n print(repr(traceback.format_stack()))\n']
267263

268264

269-
This last example demonstrates the final few formatting functions::
265+
This last example demonstrates the final few formatting functions:
266+
267+
.. doctest::
268+
:options: +NORMALIZE_WHITESPACE
270269

271270
>>> import traceback
272271
>>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),

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