Use the kbd role.
This commit is contained in:
parent
936292e0c4
commit
65c6f592cd
|
@ -1111,7 +1111,7 @@ Programming Recommendations
|
|||
|
||||
A bare ``except:`` clause will catch SystemExit and
|
||||
KeyboardInterrupt exceptions, making it harder to interrupt a
|
||||
program with Control-C, and can disguise other problems. If you
|
||||
program with :kbd:`Control-C`, and can disguise other problems. If you
|
||||
want to catch all exceptions that signal program errors, use
|
||||
``except Exception:`` (bare except is equivalent to ``except
|
||||
BaseException:``).
|
||||
|
|
|
@ -134,7 +134,7 @@ interpreter should exit will not be caught and thus be allowed to
|
|||
propagate up and allow the interpreter to terminate.
|
||||
|
||||
KeyboardInterrupt has been moved since users typically expect an
|
||||
application to exit when they press the interrupt key (usually Ctrl-C).
|
||||
application to exit when they press the interrupt key (usually :kbd:`Ctrl-C`).
|
||||
If people have overly broad ``except`` clauses the expected behaviour
|
||||
does not occur.
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ as the timeout. So the sleep can be interrupted by ``SIGINT``.
|
|||
interrupted.
|
||||
|
||||
``PyOS_StdioReadline()`` also used ``sigint_event`` when ``fgets()``
|
||||
failed to check if Ctrl-C or Ctrl-Z was pressed.
|
||||
failed to check if :kbd:`Ctrl-C` or :kbd:`Ctrl-Z` was pressed.
|
||||
|
||||
|
||||
Links
|
||||
|
|
Loading…
Reference in New Issue