From 4a7686cd33162e8ab858f94bd4efdada22ee37e6 Mon Sep 17 00:00:00 2001 From: Jonathan Brandmeyer Date: Fri, 13 Feb 2004 02:07:21 +0000 Subject: [PATCH] Check rich slicing of Numeric arrays only if Numeric or numarray is installed. [SVN r22252] --- test/slice.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/slice.py b/test/slice.py index b3c2dbcd..fb6a7b03 100644 --- a/test/slice.py +++ b/test/slice.py @@ -9,7 +9,24 @@ ... print "test passed" ... test passed ->>> check_numeric_array_rich_slice() +>>> have_numeric = 0 +>>> try: +... from Numeric import array +... have_numeric = 1 +... except: +... pass +... +>>> try: +... from numarray import array +... have_numeric = 1 +... except: +... pass +... +>>> if have_numeric: +... check_numeric_array_rich_slice() +... else: +... print 1 +... 1 >>> import sys >>> if sys.version_info[0] == 2 and sys.version_info[1] >= 3: @@ -23,7 +40,8 @@ test passed """ # Performs an affirmative and negative argument resolution check, -# checks the operation of extended slicing in Numeric.array's +# checks the operation of extended slicing in Numeric arrays +# (only performed if Numeric.array or numarray.array can be found). # checks the operation of extended slicing in new strings (Python 2.3 only). def run(args = None):