Changeset 4764


Ignore:
Timestamp:
Oct 29, 2007, 2:28:52 PM (17 years ago)
Author:
duncan
Message:

anuga can now use the python dll in C:\WINNT\system32

File:
1 edited

Legend:

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

    r4759 r4764  
    129129    v = version.replace('.','')
    130130    dllfilename = 'python%s.dll' %(v)
    131     libs = os.path.join(sys.exec_prefix,dllfilename)
    132 
     131    #libs = os.path.join(sys.exec_prefix,dllfilename)
     132    libs, is_found = set_python_dll_path()
    133133     
    134134  else:
     
    330330    return C
    331331
    332 def check_python_dll():
    333   """ Check that the python dll is present
     332def set_python_dll_path():
     333  """ Find which of the two usual hiding places the python dll is located.
     334
     335  If the file can't be found, return None.
    334336  """
    335337  import sys
     
    340342  dllfilename = 'python%s.dll' %(v)
    341343  libs = os.path.join(sys.exec_prefix,dllfilename)
    342  
     344
     345  is_found = True   
    343346  if access(libs,F_OK) == 0 :
    344     print "%s not present.\nPlease install.\nIt is available on the web." \
    345           %(libs)
     347    # Hacky - fix if you want
     348    libs = os.path.join('c:'+os.sep+'WINNT'+os.sep+'system32',dllfilename)
     349    if access(libs,F_OK) == 0 :
     350      # could not find the dll
     351      libs = os.path.join(sys.exec_prefix,dllfilename)
     352      is_found = False
     353  return libs, is_found
     354
     355def check_python_dll():
     356  libs, is_found = set_python_dll_path()
     357  if not is_found:
     358    print "%s not found.\nPlease install.\nIt is available on the web." \
     359              %(libs)
    346360    import sys; sys.exit()
     361   
    347362     
    348363if __name__ == '__main__':
    349 
    350364  from os.path import splitext
    351365  check_python_dll()
Note: See TracChangeset for help on using the changeset viewer.