Ignore:
Timestamp:
Mar 3, 2011, 6:04:03 PM (12 years ago)
Author:
wilsonr
Message:

Made changes described in ticket 359.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/compile.py

    r7940 r8124  
    175175      msg += 'One way to check this is to run %s on ' %compiler
    176176      msg += 'the commandline.'
    177       raise Exception, msg   
     177      raise Exception(msg)
    178178
    179179 
     
    192192    open(headerfile, 'r')
    193193  except:
    194     raise """Did not find Python header file %s.
     194    raise Exception("""Did not find Python header file %s.
    195195    Make sure files for Python C-extensions are installed.
    196196    In debian linux, for example, you need to install a
    197     package called something like python2.3-dev""" %headerfile
     197    package called something like python2.3-dev""" %headerfile)
    198198
    199199
     
    243243      FN = FN + '.c'
    244244    elif ext.lower() != '.c':
    245       raise Exception, "Unrecognised extension: " + FN
     245      raise Exception("Unrecognised extension: " + FN)
    246246   
    247247    try:
    248248      open(FN, 'r')
    249249    except:
    250       raise Exception, "Could not open: " + FN
     250      raise Exception("Could not open: " + FN)
    251251
    252252    if not object_files: root1 = root  #Remember first filename       
     
    293293      err = os.system(s)
    294294      if err != 0:
    295           raise 'Attempting to compile %s failed - please try manually' %FN
     295          raise Exception('Attempting to compile %s failed - please try manually' %FN)
    296296    except:
    297       raise 'Could not compile %s - please try manually' %FN 
     297      raise Exception('Could not compile %s - please try manually' %FN)
    298298
    299299 
     
    314314    err=os.system(s)
    315315    if err != 0:       
    316         raise 'Attempting to link %s failed - please try manually' %root1     
     316        raise Exception('Attempting to link %s failed - please try manually'
     317                        % root1)
    317318  except:
    318     raise 'Could not link %s - please try manually' %root1
     319    raise Exception('Could not link %s - please try manually' % root1)
    319320   
    320321
     
    352353                    msg = 'C extension %s seems to compile OK, '
    353354                    msg += 'but it can still not be imported.'
    354                     raise msg
     355                    raise Exception(msg)
    355356                else:
    356357                    C=True
     
    441442              msg = 'Could not compile C extension %s\n' %filename
    442443              msg += str(e)
    443               raise Exception, msg
     444              raise Exception(msg)
    444445          else:
    445446              print 'C extension %s OK' %filename
Note: See TracChangeset for help on using the changeset viewer.