- return os.path.join( os.getenv("MEDCOUPLING_ROOT_DIR"), "share","resources","med")
- else:
- current_dir = os.path.dirname(os.path.realpath(__file__))
- return os.path.join(current_dir, "..", "..", "..", "resources")
+ pth = os.path.join( os.getenv("MEDCOUPLING_ROOT_DIR"), "share","resources","med")
+ if os.path.exists(pth):
+ return pth
+ current_dir = os.path.dirname(os.path.realpath(__file__))
+ pth = os.path.join(current_dir, "..", "..", "..", "resources")
+ if not os.path.exists(pth):
+ raise Exception("SauvLoaderTest: Unable to get resource directory")
+ return pth