From: Stefan Behnel Date: Sat, 11 Aug 2012 19:40:46 +0000 (+0200) Subject: fix try-finally usage in STL vector test X-Git-Tag: 0.17b3~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3218a24ed813881dfcfa43a059ba8b8cf41a4533;p=platform%2Fupstream%2Fpython-cython.git fix try-finally usage in STL vector test --- diff --git a/tests/run/cpp_stl_vector.pyx b/tests/run/cpp_stl_vector.pyx index 979c40d..0d80093 100644 --- a/tests/run/cpp_stl_vector.pyx +++ b/tests/run/cpp_stl_vector.pyx @@ -10,8 +10,8 @@ def simple_test(double x): >>> simple_test(55) 3 """ + v = new vector[double]() try: - v = new vector[double]() v.push_back(1.0) v.push_back(x) from math import pi @@ -29,8 +29,8 @@ def list_test(L): >>> list_test([-1] * 1000) (1000, 1000) """ + v = new vector[int]() try: - v = new vector[int]() for a in L: v.push_back(a) return len(L), v.size() @@ -44,8 +44,8 @@ def index_test(L): >>> index_test([1.25]) (1.25, 1.25) """ + v = new vector[double]() try: - v = new vector[double]() for a in L: v.push_back(a) return v[0][0], v[0][len(L)-1] @@ -60,8 +60,8 @@ def index_set_test(L): >>> index_set_test([1.25]) (-1.25, -1.25) """ + v = new vector[double]() try: - v = new vector[double]() for a in L: v.push_back(a) for i in range(v.size()): @@ -78,8 +78,8 @@ def iteration_test(L): 4 8 """ + v = new vector[int]() try: - v = new vector[int]() for a in L: v.push_back(a) it = v.begin() @@ -98,8 +98,8 @@ def reverse_iteration_test(L): 2 1 """ + v = new vector[int]() try: - v = new vector[int]() for a in L: v.push_back(a) it = v.rbegin()