Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not attempt to detach a kernel driver under FreeBSD #67

Open
dl8dtl opened this issue Mar 1, 2025 · 0 comments
Open

Do not attempt to detach a kernel driver under FreeBSD #67

dl8dtl opened this issue Mar 1, 2025 · 0 comments

Comments

@dl8dtl
Copy link

dl8dtl commented Mar 1, 2025

Under FreeBSD, the original code throws an exception:

Could not detach kernel driver from interface(0): [Errno None] b'Unknown error'

Kernel driver detaching is not implemented (and not necessary) under FreeBSD.

The following patch solved it for me:

--- usbtmc/usbtmc.py.orig       2017-01-18 05:35:14 UTC
+++ usbtmc/usbtmc.py
@@ -841,7 +841,7 @@
             raise NotImplementedError()
 
     def _release_kernel_driver(self, interface_number):
-        if os.name == 'posix':
+        if os.name == 'posix' and os.uname()[0] != 'FreeBSD':
             if self.device.is_kernel_driver_active(interface_number):
                 self.reattach.append(interface_number)
                 try:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant