[Python-checkins] CVS: python/dist/src/Lib/test test_exceptions.py,1.15,1.16

Finn Bock bckfnn@users.sourceforge.net
Sat, 08 Dec 2001 02:15:50 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv27036

Modified Files:
	test_exceptions.py 
Log Message:
Enable support for jython:

1. Acknowledge the welknown difference that jython 
allows continue in the finally clause. 

2. Avoid using _testcapi when running with jython. 

This closes patch "[ #490417 ] Jython and test_exceptions"



Index: test_exceptions.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** test_exceptions.py	2001/09/26 20:01:09	1.15
--- test_exceptions.py	2001/12/08 10:15:48	1.16
***************
*** 5,9 ****
  import warnings
  import sys, traceback
- import _testcapi
  
  warnings.filterwarnings("error", "", OverflowWarning, __name__)
--- 5,8 ----
***************
*** 122,126 ****
          continue
  '''
! ckmsg(s, "'continue' not supported inside 'finally' clause")
  s = '''\
  try:
--- 121,129 ----
          continue
  '''
! if sys.platform.startswith('java'):
!     print "'continue' not supported inside 'finally' clause"
!     print "ok"
! else:
!     ckmsg(s, "'continue' not supported inside 'finally' clause")
  s = '''\
  try:
***************
*** 172,175 ****
--- 175,179 ----
  
  def test_capi1():
+     import _testcapi
      try:
          _testcapi.raise_exception(BadException, 1)
***************
*** 181,187 ****
      else:
          print "Expected exception"
- test_capi1()
  
  def test_capi2():
      try:
          _testcapi.raise_exception(BadException, 0)
--- 185,191 ----
      else:
          print "Expected exception"
  
  def test_capi2():
+     import _testcapi
      try:
          _testcapi.raise_exception(BadException, 0)
***************
*** 195,199 ****
      else:
          print "Expected exception"
! test_capi2()
  
  unlink(TESTFN)
--- 199,206 ----
      else:
          print "Expected exception"
! 
! if not sys.platform.startswith('java'):
!     test_capi1()
!     test_capi2()
  
  unlink(TESTFN)