[Python-checkins] CVS: python/dist/src/Lib/curses wrapper.py,1.1,1.2

A.M. Kuchling python-dev@python.org
Sat, 10 Jun 2000 16:39:07 -0700


Update of /cvsroot/python/python/dist/src/Lib/curses
In directory slayer.i.sourceforge.net:/tmp/cvs-serv19653

Modified Files:
	wrapper.py 
Log Message:
Applied simplifications suggested by Greg Stein.


Index: wrapper.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/curses/wrapper.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** wrapper.py	2000/06/10 23:06:53	1.1
--- wrapper.py	2000/06/10 23:39:05	1.2
***************
*** 18,22 ****
      """
      
-     res = None
      try:
  	# Initialize curses
--- 18,21 ----
***************
*** 31,50 ****
          stdscr.keypad(1)
  
!         res = apply(func, (stdscr,) + rest)
!     except:
! 	# In the event of an error, restore the terminal
! 	# to a sane state.
  	stdscr.keypad(0)
  	curses.echo() ; curses.nocbreak()
  	curses.endwin()
-         # Pass the exception upwards
-         (exc_type, exc_value, exc_traceback) = sys.exc_info()
-         raise exc_type, exc_value, exc_traceback
-     else:
- 	# Set everything back to normal
- 	stdscr.keypad(0)
- 	curses.echo() ; curses.nocbreak()
- 	curses.endwin()		 # Terminate curses
- 
-         return res
  
--- 30,39 ----
          stdscr.keypad(1)
  
! 	return apply(func, (stdscr,) + rest)
! 
!     finally:
! 	# Restore the terminal to a sane state on the way out.
  	stdscr.keypad(0)
  	curses.echo() ; curses.nocbreak()
  	curses.endwin()