Skip to content

Commit

Permalink
Compatibility with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarcireau committed Sep 29, 2023
1 parent b43e320 commit de07f84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "python"
version = "0.8.2"
version = "0.8.3"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
8 changes: 6 additions & 2 deletions python/python/neuromorphic_drivers/udev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit de07f84

Please sign in to comment.