Changeset 4759


Ignore:
Timestamp:
Oct 29, 2007, 10:55:13 AM (17 years ago)
Author:
duncan
Message:

check for the python24.dll

File:
1 edited

Legend:

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

    r4712 r4759  
    1111"""     
    1212
     13import os, string, sys, types
    1314 
    1415def compile(FNs=None, CC=None, LD = None, SFLAG = None, verbose = 1):
     
    2425  """
    2526 
    26  
    27  
    28   import os, string, sys, types
    29  
    3027  # Input check
    3128  #
     
    134131    libs = os.path.join(sys.exec_prefix,dllfilename)
    135132
    136      
    137133     
    138134  else:
     
    334330    return C
    335331
    336 
     332def check_python_dll():
     333  """ Check that the python dll is present
     334  """
     335  import sys
     336  from os import access, F_OK
     337 
     338  version = sys.version[:3]
     339  v = version.replace('.','')
     340  dllfilename = 'python%s.dll' %(v)
     341  libs = os.path.join(sys.exec_prefix,dllfilename)
     342 
     343  if access(libs,F_OK) == 0 :
     344    print "%s not present.\nPlease install.\nIt is available on the web." \
     345          %(libs)
     346    import sys; sys.exit()
     347     
    337348if __name__ == '__main__':
    338349
    339 
    340   import sys, os
    341350  from os.path import splitext
    342  
     351  check_python_dll()
    343352  if len(sys.argv) > 1:
    344353      files = sys.argv[1:]
Note: See TracChangeset for help on using the changeset viewer.