#NEWLINE# def test_issue_1265( self ) : #NEWLINE# #INDENT# '\n        Double-free for locally allocated, non escaping NRT objects\n        ' #NEWLINE# def py_gen( rmin , rmax , nr ) : #NEWLINE# #INDENT# a = np . linspace ( rmin , rmax , nr ) #NEWLINE# ( yield a [ 0 ] ) #NEWLINE# ( yield a [ 1 ] ) #NEWLINE# #UNINDENT# c_gen = jit ( nopython = True ) ( patches ) #NEWLINE# py_res = list ( py_gen ( ( - 2 ) , 2 , 100 ) ) #NEWLINE# c_res = list ( c_gen ( ( - 2 ) , 2 , 100 ) ) #NEWLINE# self . assertEqual ( py_res , c_res ) #NEWLINE# def py_driver( args ) : #NEWLINE# #INDENT# ( rmin , rmax , nr ) = args #NEWLINE# points = np . empty ( nr , dtype = np . complex128 ) #NEWLINE# for ( i , c ) in enumerate ( py_gen ( rmin , rmax , nr ) ) : #NEWLINE# #INDENT# points [ i ] = c #NEWLINE# #UNINDENT# return points #NEWLINE# #UNINDENT# @ jit ( nopython = True ) #NEWLINE# def c_driver( args ) : #NEWLINE# #INDENT# ( rmin , rmax , nr ) = args #NEWLINE# points = np . empty ( nr , dtype = np . complex128 ) #NEWLINE# for ( i , c ) in enumerate ( c_gen ( rmin , rmax , nr ) ) : #NEWLINE# #INDENT# points [ i ] = c #NEWLINE# #UNINDENT# return points #NEWLINE# #UNINDENT# n = 2 #NEWLINE# patches = ( ( - 2 ) , ( - 1 ) , n ) #NEWLINE# py_res = py_driver ( patches ) #NEWLINE# c_res = c_driver ( patches ) #NEWLINE# np . testing . assert_equal ( py_res , c_res )