In 31c029238 (#557), I improved the error message printed when the module is outside of the root dir to include the file path of the imported module. That's not enough to troubleshoot the problem, because we print the non-canonical path, which is potentially different from the string we use to check if the module path is within the root dir.
In this commit, I refactored the method to make the code easier to follow, and improved the error message to print the canonicalized paths of the module and the root dir.
In 31c029238 (#557), I improved the error message printed when the module is outside of the root dir to include the file path of the imported module. That's not enough to troubleshoot the problem, because we print the non-canonical path, which is potentially different from the string we use to check if the module path is within the root dir.
In this commit, I refactored the method to make the code easier to follow, and improved the error message to print the canonicalized paths of the module and the root dir.
Links: