Skip to content

GaudiProjectConfig: Fix generated __init__ files to handle symlinks.

Scott Snyder requested to merge ssnyder/Gaudi:pypath-20180315 into master

The init.py files generated from GaudiProjectConfig.cmake has code like:

__path__ = [d for d in [os.path.join(d, '${pypack}') for d in sys.path if d]
            if (d.startswith('${CMAKE_BINARY_DIR}') or

However, if the working path contains a symlink, then the element in sys.path may have the symlink, but the value from ${CMAKE_BINARY_DIR} to which we compare it will have the symlink expanded. Change to expand any symlinks (using os.path.realname) in the paths from sys.path before comparing.

Merge request reports