File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,19 +151,17 @@ class TestAstList(unittest.TestCase):
151151
152152 def test_concat (self ):
153153 # Issue gh-356 Java IndexOOB error on append
154- body = ast .parse ('x=1' ).body # _ast.AstList
155- p = [ast .Pass ()] # PyList
154+ body = ast .parse ('x=1; global y; y+=x*2 ' ).body # _ast.AstList
155+ p = [ast .Pass (), ast . Break ()] # PyList
156156 x = body + p
157- self .assertEqual (2 , len (x ))
158- self .assertIsInstance (x [1 ], ast .Pass )
157+ self .assertEqual (x [- 2 :], p )
159158
160159 def test_append (self ):
161160 # Issue gh-356 Java IndexOOB error on append
162- body = ast .parse ('x=1' ).body # _ast.AstList
163- p = [ast .Pass ()] # PyList
161+ body = ast .parse ('x=1; global y; y+=x*2 ' ).body # _ast.AstList
162+ p = [ast .Pass (), ast . Break ()] # PyList
164163 body += p
165- self .assertEqual (2 , len (body ))
166- self .assertIsInstance (body [1 ], ast .Pass )
164+ self .assertEqual (body [- 2 :], p )
167165
168166
169167#==============================================================================
Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ New Features
2929 deprecated for removal in Java 26. See https://github.com/jnr/jffi/issues/165
3030
3131Jython 2.7.5a1 Bugs fixed
32- - [ GH-382 ] Java EE Servlet Namespace Has Been Changed From javax.servlet to jakarta.servlet
33- - [ GH-84 ] PyServlet Will Need To Use The jakarta.servlet Namespace #84
32+ - [ GH-382 ] Java EE Servlet namespace changed from javax.servlet to jakarta.servlet
33+ - [ GH-356 ] _ast.astlist.__add__ leads to Java exception
34+ - [ GH-84 ] PyServlet will need to use the jakarta.servlet namespace
3435
3536
3637==============================================================================
You can’t perform that action at this time.
0 commit comments