Kaydet (Commit) 16b83b1f authored tarafından Berker Peksag's avatar Berker Peksag

Issue #24173: Fix curses.wrapper link in curses HOWTO

üst ccff2bbd
...@@ -122,13 +122,12 @@ raises an uncaught exception. Keys are no longer echoed to the screen when ...@@ -122,13 +122,12 @@ raises an uncaught exception. Keys are no longer echoed to the screen when
you type them, for example, which makes using the shell difficult. you type them, for example, which makes using the shell difficult.
In Python you can avoid these complications and make debugging much easier by In Python you can avoid these complications and make debugging much easier by
importing the module :mod:`curses.wrapper`. It supplies a :func:`wrapper` importing the :func:`curses.wrapper` function. It takes a callable and does
function that takes a callable. It does the initializations described above, the initializations described above, also initializing colors if color support
and also initializes colors if color support is present. It then runs your is present. It then runs your provided callable and finally deinitializes
provided callable and finally deinitializes appropriately. The callable is appropriately. The callable is called inside a try-catch clause which catches
called inside a try-catch clause which catches exceptions, performs curses exceptions, performs curses deinitialization, and then passes the exception
deinitialization, and then passes the exception upwards. Thus, your terminal upwards. Thus, your terminal won't be left in a funny state on exception.
won't be left in a funny state on exception.
Windows and Pads Windows and Pads
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment