diff --git a/python/Cargo.toml b/python/Cargo.toml index 5331de1..f139d76 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "python" -version = "0.8.2" +version = "0.8.3" edition = "2021" [lib] diff --git a/python/pyproject.toml b/python/pyproject.toml index 9a25060..90875b2 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -7,7 +7,7 @@ authors = [ {name = "International Centre for Neuromorphic Systems"}, {name = "Alexandre Marcireau"}, ] -version = "0.8.2" +version = "0.8.3" requires-python = ">=3.8" dependencies = ["numpy>=1.24"] diff --git a/python/python/neuromorphic_drivers/udev.py b/python/python/neuromorphic_drivers/udev.py index e12fd6d..e3c4b40 100644 --- a/python/python/neuromorphic_drivers/udev.py +++ b/python/python/neuromorphic_drivers/udev.py @@ -27,11 +27,15 @@ def install_udev_rules( if os.geteuid() != 0: cwd = pathlib.Path.cwd() executable = pathlib.Path(sys.executable).resolve() - if executable.is_relative_to(cwd): + try: executable = executable.relative_to(cwd) + except ValueError: + pass file = pathlib.Path(__file__).resolve() - if file.is_relative_to(cwd): + try: file = file.relative_to(cwd) + except ValueError: + pass sys.stdout.write( f"\033[1mrun the following command to enable non-root access to devices\033[0m\n\nsudo {executable} {file}\n\n" )