summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-03-09 10:42:23 (GMT)
committerNed Deily <nad@acm.org>2011-03-09 10:42:23 (GMT)
commit2d12f96658db7f1257ac8e15908ce0a8ac96f735 (patch)
tree1290f5d9fc731baab2fa610e563869c4aee1e76d /Lib
parentd9512e9ac11cb6b22669d7c06a321dbeb56ec0f5 (diff)
parentd2853180dfd905d07aa07d6f95cc4736d5363f22 (diff)
downloadcpython-2d12f96658db7f1257ac8e15908ce0a8ac96f735.zip
cpython-2d12f96658db7f1257ac8e15908ce0a8ac96f735.tar.gz
cpython-2d12f96658db7f1257ac8e15908ce0a8ac96f735.tar.bz2
Issue #5622: merge fix from 3.1.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/curses/wrapper.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/curses/wrapper.py b/Lib/curses/wrapper.py
index 3cdaa82..5183ce7 100644
--- a/Lib/curses/wrapper.py
+++ b/Lib/curses/wrapper.py
@@ -43,7 +43,8 @@ def wrapper(func, *args, **kwds):
return func(stdscr, *args, **kwds)
finally:
# Set everything back to normal
- stdscr.keypad(0)
- curses.echo()
- curses.nocbreak()
- curses.endwin()
+ if 'stdscr' in locals():
+ stdscr.keypad(0)
+ curses.echo()
+ curses.nocbreak()
+ curses.endwin()