Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/python/neuropod/backends/python/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ def addition_model(x, y):
for copy_spec in code_path_spec:
python_root = copy_spec["python_root"]

if os.path.realpath(neuropod_path).startswith(
#Ensures that neuropod_path is not a subdirectory of python_root
#Ensures neuropod_path and python_root are not the same directory
if os.path.samefile(neuropod_path,python_root) or os.path.realpath(neuropod_path).startswith(
os.path.realpath(python_root) + os.sep
):
raise ValueError(
"`neuropod_path` cannot be a subdirectory of `python_root`"
"`neuropod_path` cannot be the same directory as `python_root' or a subdirectory of `python_root`"
)

for dir_to_package in copy_spec["dirs_to_package"]:
Expand Down