Changeset 2611 for trunk

Show
Ignore:
Timestamp:
06/23/2008 12:21:00 PM (7 months ago)
Author:
wd15
Message:

Moved the inline flag check to the import (init.py) so that it is done only once. The inline tests were broken. After a compile failure the inline tests were being switched off as weave does not get to do its exit strategy and so sys.argv was being permanently changed

Location:
trunk/fipy/tools/inline
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/fipy/tools/inline/__init__.py

    r187 r2611  
     1import sys 
     2 
     3if '--inline' in sys.argv[1:]: 
     4    inlineFlagOn = True 
     5else: 
     6    inlineFlagOn = False 
  • trunk/fipy/tools/inline/inline.py

    r2274 r2611  
    11import sys 
    2 from fipy.tools import numerix  
     2from fipy.tools import numerix 
     3from fipy.tools.inline import inlineFlagOn 
    34 
    45def _optionalInline(inlineFn, pythonFn, *args): 
    5     if '--inline' in sys.argv[1:]: 
     6    if inlineFlagOn: 
    67        return inlineFn(*args) 
    78    else: 
     
    3940        if hasattr(args[key], 'dtype') and args[key].dtype.char == '?': 
    4041            args[key] = args[key].astype('B') 
    41              
     42 
    4243    weave.inline(code, 
    4344                 args.keys(), 
     
    4849                 verbose = 0 or verbose, 
    4950                 extra_compile_args =['-O3']) 
    50  
    5151                  
    5252def _runIterateElementInline(code_in, converters=None, verbose=0, **args):